You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "grundprinzip (via GitHub)" <gi...@apache.org> on 2023/07/03 14:49:15 UTC

[GitHub] [spark] grundprinzip commented on a diff in pull request #41748: [SPARK-44145][SQL] Callback when ready for execution

grundprinzip commented on code in PR #41748:
URL: https://github.com/apache/spark/pull/41748#discussion_r1250990805


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -622,21 +622,43 @@ class SparkSession private(
    *             For example, 1, "Steven", LocalDate.of(2023, 4, 2).
    *             A value can be also a `Column` of literal expression, in that case
    *             it is taken as is.
+   * @param tracker A tracker that can notify when query is ready for execution
    *
    * @since 3.5.0
    */
   @Experimental
-  def sql(sqlText: String, args: Array[_]): DataFrame = withActive {
-    val tracker = new QueryPlanningTracker
-    val plan = tracker.measurePhase(QueryPlanningTracker.PARSING) {
-      val parsedPlan = sessionState.sqlParser.parsePlan(sqlText)
-      if (args.nonEmpty) {
-        PosParameterizedQuery(parsedPlan, args.map(lit(_).expr))
-      } else {
-        parsedPlan
+  def sql(sqlText: String, args: Array[_], tracker: QueryPlanningTracker): DataFrame =

Review Comment:
   Looking at these new methods, I don't think that they offer a lot of benefit to outside callers and they are not easy to use. can we make these new methods that have been added `private[sql]`?
   
   @HyukjinKwon @juliuszsompolski what do you think?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org