LuciferYang commented on code in PR #52819:
URL: https://github.com/apache/spark/pull/52819#discussion_r2510693110
##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectDatabaseMetaData.scala:
##########
@@ -299,11 +304,60 @@ class SparkConnectDatabaseMetaData(conn:
SparkConnectConnection) extends Databas
new SparkConnectResultSet(df.collectResult())
}
- override def getSchemas: ResultSet =
- throw new SQLFeatureNotSupportedException
+ override def getSchemas: ResultSet = {
+ conn.checkOpen()
- override def getSchemas(catalog: String, schemaPattern: String): ResultSet =
- throw new SQLFeatureNotSupportedException
+ getSchemas(null, null)
+ }
+
+ // Schema of the returned DataFrame is:
+ // |-- TABLE_SCHEM: string (nullable = false)
+ // |-- TABLE_CATALOG: string (nullable = false)
+ private def getSchemasDataFrame(
+ catalog: String, schemaPattern: String): connect.DataFrame = {
+
+ val schemaFilterClause = if (isNullOrWildcard(schemaPattern)) {
Review Comment:
how about
```
val schemaFilter = if (isNullOrWildcard(schemaPattern)) {
lit(true)
} else {
col("TABLE_SCHEM").like(schemaPattern)
}
```
--
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]