szehon-ho commented on code in PR #16626:
URL: https://github.com/apache/iceberg/pull/16626#discussion_r3352841030
##########
spark/v4.1/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/IcebergSparkSqlExtensionsParser.scala:
##########
@@ -125,6 +126,24 @@ class IcebergSparkSqlExtensionsParser(delegate:
ParserInterface)
}
}
+ /**
+ * Parse a string to a LogicalPlan, binding the given parameters.
+ */
+ override def parsePlanWithParameters(
Review Comment:
nit (non-blocking): this shares its entire iceberg-detect-and-dispatch
skeleton with `parsePlan`; the two now differ only in the delegate call. Could
factor the common part into a small private helper to avoid drift, though
leaving it explicit is also defensible given the "keep it minimal" preference.
##########
spark/v4.1/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/parser/extensions/IcebergSparkSqlExtensionsParser.scala:
##########
@@ -125,6 +126,24 @@ class IcebergSparkSqlExtensionsParser(delegate:
ParserInterface)
}
}
+ /**
+ * Parse a string to a LogicalPlan, binding the given parameters.
+ */
+ override def parsePlanWithParameters(
+ sqlText: String,
+ parameterContext: ParameterContext): LogicalPlan = {
+ val sqlTextAfterSubstitution = substitutor.substitute(sqlText)
+ if (isIcebergCommand(sqlTextAfterSubstitution)) {
+ // Iceberg DDL grammars do not accept parameter markers (`?` / `:name`),
so the
Review Comment:
non-blocking: agree dropping the context here is correct since the Iceberg
grammar has no parameter markers. One nicety for a follow-up could be to fail
fast if a non-empty `parameterContext` reaches an Iceberg command, rather than
silently ignoring it — but not needed for this PR.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]