rdblue commented on a change in pull request #24741: [SPARK-27322][SQL] 
DataSourceV2: Select from multiple catalogs
URL: https://github.com/apache/spark/pull/24741#discussion_r290848219
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/rules.scala
 ##########
 @@ -36,17 +36,18 @@ import org.apache.spark.sql.util.SchemaUtils
  * Replaces [[UnresolvedRelation]]s if the plan is for direct query on files.
  */
 class ResolveSQLOnFile(sparkSession: SparkSession) extends Rule[LogicalPlan] {
+
   private def maybeSQLFile(u: UnresolvedRelation): Boolean = {
-    sparkSession.sessionState.conf.runSQLonFile && 
u.tableIdentifier.database.isDefined
+    sparkSession.sessionState.conf.runSQLonFile && u.multipartIdentifier.size 
== 2
 
 Review comment:
   This is a separate problem, but could you also file an issue to fix this 
rule? This relies on rule ordering for correctness because it will convert any 
2-part identifier to a SQL-on-file plan if the namespace is also a DataSource 
name. This should additionally check that the path either looks like a path 
(contains `/`) or exists in some file system.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to