pan3793 commented on code in PR #52757:
URL: https://github.com/apache/spark/pull/52757#discussion_r2476301450


##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectDatabaseMetaData.scala:
##########
@@ -76,8 +77,11 @@ class SparkConnectDatabaseMetaData(conn: 
SparkConnectConnection) extends Databas
 
   override def getIdentifierQuoteString: String = "`"
 
-  override def getSQLKeywords: String =
-    throw new SQLFeatureNotSupportedException
+  override def getSQLKeywords: String = {
+    conn.checkOpen()
+    conn.spark.sql("SELECT keyword FROM sql_keywords()").collect()
+      .map(_.getString(0)).diff(SQL_2003_RESERVED_KEYWORDS).mkString(",")

Review Comment:
   according to 
https://github.com/apache/spark/blob/56eaa8d2ac8c7e253cdc6df341c54cf98262cbbd/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/SQLKeywordUtils.scala#L27-L35
   
   the returned values of `sql_keywords()` are guaranteed to be UPPER CASE and 
sorted, so I think we don't need to do it again.



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