zhengruifeng commented on code in PR #41516:
URL: https://github.com/apache/spark/pull/41516#discussion_r1224989441
##########
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:
this only works for Connect Clients. For vanilla Spark (both scala and
python), it will still be unaware of such kind of changes, since the expression
is directly built in the functions.
To prevent functions from such behavior changes, I guess what we can do is
adding more parity tests to compare function with `selectExpr`
--
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]