nastra commented on code in PR #9340: URL: https://github.com/apache/iceberg/pull/9340#discussion_r1432637532
########## spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/V2ViewDescription.scala: ########## @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.spark.sql.catalyst.analysis + +import org.apache.spark.sql.catalyst.plans.logical.ViewDescription +import org.apache.spark.sql.connector.catalog.View +import org.apache.spark.sql.connector.catalog.ViewCatalog +import org.apache.spark.sql.types.StructType +import scala.collection.JavaConverters._ + +/** + * View description backed by a View in V2 catalog. + * + * @param view a view in V2 catalog + */ +case class V2ViewDescription(override val identifier: String, view: View) + extends ViewDescription { + + override val schema: StructType = view.schema + + override val viewText: Option[String] = Option(view.query) + + override val viewCatalogAndNamespace: Seq[String] = + view.currentCatalog +: view.currentNamespace.toSeq + + override val viewQueryColumnNames: Seq[String] = view.schema.fieldNames + + val query: String = view.query + + val comment: Option[String] = Option(view.properties.get(ViewCatalog.PROP_COMMENT)) + + val owner: Option[String] = Option(view.properties.get(ViewCatalog.PROP_OWNER)) Review Comment: no, this is the same as in https://github.com/apache/spark/pull/44197/files#diff-d0c6f499b30df039d13bf2740c559251ab63ba4cea312e622e23b74fcbb2fcf0R55 and is later used in https://github.com/apache/spark/pull/44197/files#diff-20333925586e4368b41490d2525a7a0d7773990472986d1750723edf12ee5227R56 -- 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