3

我想选择表中除 StudentAddress 之外的所有列,因此我编写了以下查询:

select `(StudentAddress)?+.+` from student;

它在 Squirrel Sql 客户端中出现以下错误。org.apache.spark.sql.AnalysisException:无法解析“ (StudentAddress)?+.+”给定的输入列

4

1 回答 1

7

您可以使用DataFrame API 中的drop()方法删除特定列,然后选择所有列。

例如:

val df = hiveContext.read.table("student")
val dfWithoutStudentAddress = df.drop("StudentAddress")
于 2017-11-17T04:09:32.763 回答