viirya commented on a change in pull request #23376: [SPARK-26435][SQL] Support
creating partitioned table using Hive CTAS by specifying partition column names
URL: https://github.com/apache/spark/pull/23376#discussion_r243910245
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala
##########
@@ -1196,13 +1196,16 @@ class SparkSqlAstBuilder(conf: SQLConf) extends
AstBuilder(conf) {
selectQuery match {
case Some(q) =>
- // Hive does not allow to use a CTAS statement to create a partitioned
table.
+ // Hive does not allow to use a CTAS statement to create a partitioned
table
+ // by specifying table schema.
if (tableDesc.partitionColumnNames.nonEmpty) {
val errorMessage = "A Create Table As Select (CTAS) statement is not
allowed to " +
- "create a partitioned table using Hive's file formats. " +
+ "create a partitioned table using Hive's file formats by
specifying table schema. " +
"Please use the syntax of \"CREATE TABLE tableName USING
dataSource " +
"OPTIONS (...) PARTITIONED BY ...\" to create a partitioned table
through a " +
- "CTAS statement."
+ "CTAS statement. Since Spark 3.0, you can specify partition column
names " +
Review comment:
Ok. Removed version info.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]