cloud-fan commented on code in PR #51714:
URL: https://github.com/apache/spark/pull/51714#discussion_r2242098822
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/CreateSQLFunctionCommand.scala:
##########
@@ -445,6 +449,42 @@ case class CreateSQLFunctionCommand(
}
}
+ /**
+ * Derive the SQL data access routine of the function and check if the SQL
function matches
+ * its data access routine. If the data access is CONTAINS SQL, the
expression should not
+ * access operators and expressions that read SQL data.
+ *
+ * Returns true is SQL data access routine is READS SQL DATA, otherwise
returns false.
+ */
+ private def deriveSQLDataAccess(plan: LogicalPlan): Boolean = {
+ // Find logical plan nodes that read SQL data.
+ val readsSQLData = plan.find {
+ case _: View => true
+ case l: LeafNode => l match {
Review Comment:
instead of checking LeafNode, we should check all plans that
`plan.children.isEmpty`
--
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]