jzhuge 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_r290983004
##########
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:
Sounds good.
What should be the expected behavior for this test in sql.SQLQuerySuite."run
sql directly on files"?
```
e = intercept[AnalysisException] {
sql("select * from json.invalid_file")
}
assert(e.message.contains("Path does not exist"))
```
----------------------------------------------------------------
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]