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_r290983731
##########
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:
I think it should be that the table could not be found. If there were some
way to determine that it is a path, like checking for `/`, then that message
would be correct. So it could be updated to this:
```scala
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]