rdblue commented on a change in pull request #2165:
URL: https://github.com/apache/iceberg/pull/2165#discussion_r565738137
##########
File path:
spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/IcebergSqlExtensionsAstBuilder.scala
##########
@@ -79,12 +81,33 @@ class IcebergSqlExtensionsAstBuilder(delegate:
ParserInterface) extends IcebergS
}
/**
- * Create a WRITE ORDERED BY logical command.
+ * Create a [[SetWriteDistributionAndOrdering]] for changing the write
distribution and ordering.
*/
- override def visitSetTableOrder(ctx: SetTableOrderContext): SetWriteOrder =
withOrigin(ctx) {
- SetWriteOrder(
- typedVisit[Seq[String]](ctx.multipartIdentifier),
- ctx.order.fields.asScala.map(typedVisit[(Term, SortDirection,
NullOrder)]).toArray)
+ override def visitSetWriteDistributionAndOrdering(
+ ctx: SetWriteDistributionAndOrderingContext):
SetWriteDistributionAndOrdering = {
+
+ val tableName = typedVisit[Seq[String]](ctx.multipartIdentifier)
+
+ val distributionSpec = ctx.writeDistributionSpec
+ val orderingSpec = ctx.writeOrderingSpec
+
+ if (distributionSpec == null && orderingSpec == null) {
+ throw new AnalysisException("Distribution and ordering spec cannot be
empty at the same time")
Review comment:
How about "ALTER TABLE has no changes: missing both distribute by and
order by clauses"
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]