beliefer commented on code in PR #41516:
URL: https://github.com/apache/spark/pull/41516#discussion_r1223802410
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/functions.scala:
##########
@@ -2807,6 +2807,38 @@ object functions {
// Misc functions
//////////////////////////////////////////////////////////////////////////////////////////////
+ /**
+ * Returns the current catalog.
+ *
+ * @group misc_funcs
+ * @since 3.5.0
+ */
+ def current_catalog(): Column = Column.fn("current_catalog")
+
+ /**
+ * Returns the current database.
+ *
+ * @group misc_funcs
+ * @since 3.5.0
+ */
+ def current_database(): Column = Column.fn("current_database")
+
+ /**
+ * Returns the current schema.
+ *
+ * @group misc_funcs
+ * @since 3.5.0
+ */
+ def current_schema(): Column = current_database()
Review Comment:
I'm a little afraid. If the `current_schema` have the different
implementation from `current_database` in future but sometimes they have the
same output (means `current_schema` doesn't reuse `CurrentDatabase` and create
a new expression `CurrentSchema`), The behavior will not change. Personally, I
think `Column.fn("current_schema")` is better.
--
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]