rdblue commented on code in PR #9510: URL: https://github.com/apache/iceberg/pull/9510#discussion_r1468936985
########## spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ExtendedDataSourceV2Strategy.scala: ########## @@ -123,6 +127,35 @@ case class ExtendedDataSourceV2Strategy(spark: SparkSession) extends Strategy wi allowExisting = allowExisting, replace = replace) :: Nil + case AlterViewAs(ResolvedV2View(catalog, ident, _), queryText, query) => + CreateV2ViewExec( + catalog = catalog, + ident = ident, + queryText = queryText, + columnAliases = Seq.empty, + columnComments = Seq.empty, + queryColumnNames = query.schema.fieldNames, + viewSchema = query.schema, + comment = None, + properties = Map.empty, + allowExisting = false, + replace = true) :: Nil + + case SetViewProperties(ResolvedV2View(catalog, ident, _), properties) => + val changes = properties.map { + case (property, value) => ViewChange.setProperty(property, value) + }.toSeq + AlterV2ViewExec(catalog, ident, changes) :: Nil + + case UnsetViewProperties(ResolvedV2View(catalog, ident, view), propertyKeys, ifExists) => + if (!ifExists) { + propertyKeys.filterNot(view.properties.containsKey).foreach { property => + throw new AnalysisException(s"Attempted to unset non-existing property '$property' in view $ident") Review Comment: This should be done in execution, not in the conversion to a physical plan. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org