cloud-fan commented on code in PR #45440:
URL: https://github.com/apache/spark/pull/45440#discussion_r1519158838


##########
sql/core/src/main/scala/org/apache/spark/sql/internal/SparkAnalyzer.scala:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.internal
+
+import org.apache.spark.sql.catalyst.QualifiedTableName
+import org.apache.spark.sql.catalyst.analysis.Analyzer
+import org.apache.spark.sql.catalyst.catalog.CatalogTable
+import org.apache.spark.sql.connector.catalog.{CatalogManager, Table, V1Table}
+import org.apache.spark.sql.connector.expressions.Transform
+import 
org.apache.spark.sql.execution.datasources.v2.DataSourceV2Utils.{getDataSourceOptions,
 getTableProvider}
+
+class SparkAnalyzer(catalogManager: CatalogManager) extends 
Analyzer(catalogManager) {
+
+  override def resolveDataSourceV2Table(t: Table): Table = t match {

Review Comment:
   a custom v2 session catalog can extend `DelegatingCatalogExtension` and take 
the `Table` returned by `V2SessionCatalog.loadTable` then return something 
else. That said, we should keep `V2SessionCatalog.loadTable` to return 
`V1Table` and resolve data source v2 table provider afterwards, which is after 
calling `CatalogV2Utils.loadTable`



-- 
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]

Reply via email to