假设您有以下代码:
df = sqlContext.read.parquet('s3://somebucket/some_parquet_file')
如何将订单链接到该对象?
df = df.orderBy(df.some_col)
使它成为:
df = sqlContext.read.parquet('s3://somebucket/some_parquet_file').orderBy(?.some_col)
答案 0 :(得分:1)
您可以将列名称指定为string or a list of strings:
df = sqlContext.read.parquet('s3://somebucket/some_parquet_file').orderBy("some_col")