Spark SQL的selectExpr用法

转载:http://ddrv.cn/a/248617

两者等价,可看作把sql语句直接拿来使用

df1.selectExpr("*","(DEST_COUNTRY_NAME = ORIGIN_COUNTRY_NAME) as withincountry").show(5)
spark.sql("select * ,
(DEST_COUNTRY_NAME = ORIGIN_COUNTRY_NAME) as withincountry from dfTable limit 5")

猜你喜欢

转载自blog.csdn.net/weixin_43648241/article/details/108911178
今日推荐