codope commented on code in PR #11650:
URL: https://github.com/apache/hudi/pull/11650#discussion_r1686011329
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/analysis/HoodieAnalysis.scala:
##########
@@ -428,6 +428,12 @@ case class ResolveImplementationsEarly() extends
Rule[LogicalPlan] {
if sparkAdapter.isHoodieTable(table) && ct.query.forall(_.resolved) =>
CreateHoodieTableAsSelectCommand(table, mode, query)
+ case ct: CreateTable =>
+ // NOTE: In case of CreateTable with schema and multiple partition
fields,
+ // we have to make sure that partition fields are ordered in the same
way as they are in the schema.
+ HoodieSchemaUtils.checkPartitionSchemaOrder(ct.tableDesc.schema,
ct.tableDesc.partitionColumnNames)
Review Comment:
CTAS is handled in the case above but good point about `df.saveAsTable`.
Will fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]