WeichenXu123 commented on code in PR #50244: URL: https://github.com/apache/spark/pull/50244#discussion_r1990350728
########## mllib/src/main/scala/org/apache/spark/ml/feature/SQLTransformer.scala: ########## @@ -78,8 +79,19 @@ class SQLTransformer @Since("1.6.0") (@Since("1.6.0") override val uid: String) @Since("1.6.0") override def transformSchema(schema: StructType): StructType = { val spark = SparkSession.builder().getOrCreate() - val dummyRDD = spark.sparkContext.parallelize(Seq(Row.empty)) - val dummyDF = spark.createDataFrame(dummyRDD, schema) + + val parsedPlan = spark.sessionState.sqlParser.parsePlan($(statement)) + parsedPlan match { + case _: Project => + case _: Filter => + case _: Aggregate => + case _: Sort => Review Comment: is it possible that the statement contains nested clause doing modification to data ? -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org