Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update error message.
  • Loading branch information
jiangxb1987 committed Mar 7, 2018
commit 48fc338dc30720aa05e1871d69bad66ae2dfaa59
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ case class AlterTableChangeColumnCommand(
schema.fields.collectFirst {
case field if resolver(field.name, name) => field
}.getOrElse(throw new AnalysisException(
s"Invalid column reference '$name', table data schema is '${schema}'"))
s"Can't find column `$name` given table data columns " +
s"${schema.fieldNames.mkString("[`", "`, `", "`]")}"))
}

// Add the comment to a column, if comment is empty, return the original column.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ ALTER TABLE test_change CHANGE invalid_col invalid_col INT
struct<>
-- !query 15 output
org.apache.spark.sql.AnalysisException
Invalid column reference 'invalid_col', table data schema is 'StructType(StructField(a,IntegerType,true), StructField(b,StringType,true), StructField(c,IntegerType,true))';
Can't find column `invalid_col` given table data columns [`a`, `b`, `c`];


-- !query 16
Expand Down Expand Up @@ -296,7 +296,7 @@ ALTER TABLE partition_table CHANGE COLUMN c c INT COMMENT 'this is column C'
struct<>
-- !query 30 output
org.apache.spark.sql.AnalysisException
Invalid column reference 'c', table data schema is 'StructType(StructField(a,IntegerType,true), StructField(b,StringType,true))';
Can't find column `c` given table data columns [`a`, `b`];


-- !query 31
Expand Down