nastra commented on code in PR #14681:
URL: https://github.com/apache/iceberg/pull/14681#discussion_r2567436878
##########
spark/v4.0/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/views/CreateIcebergView.scala:
##########
@@ -33,12 +34,20 @@ case class CreateIcebergView(
properties: Map[String, String],
allowExisting: Boolean,
replace: Boolean,
- rewritten: Boolean = false) extends BinaryCommand {
- override def left: LogicalPlan = child
+ rewritten: Boolean = false,
+ // Align Iceberg CreateIcebergView with Spark’s CreateViewCommand by
extending AnalysisOnlyCommand.
+ // The command’s children are analyzed then hidden, so the optimizer/planner
won’t traverse the view body.
+ isAnalyzed: Boolean = false) extends AnalysisOnlyCommand {
- override def right: LogicalPlan = query
+ override def childrenToAnalyze: Seq[LogicalPlan] = child :: query :: Nil
- override protected def withNewChildrenInternal(
- newLeft: LogicalPlan, newRight: LogicalPlan): LogicalPlan =
- copy(child = newLeft, query = newRight)
+ def markAsAnalyzed(analysisContext: AnalysisContext): LogicalPlan = {
Review Comment:
```
override def markAsAnalyzed(analysisContext: AnalysisContext): LogicalPlan =
{
copy(isAnalyzed = true)
}
```
--
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]