miland-db commented on code in PR #48879:
URL: https://github.com/apache/spark/pull/48879#discussion_r1848323060


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/SqlScriptingLogicalPlans.scala:
##########
@@ -15,25 +15,25 @@
  * limitations under the License.
  */
 
-package org.apache.spark.sql.catalyst.parser
+package org.apache.spark.sql.catalyst.plans.logical
+
+import org.apache.spark.sql.catalyst.expressions.Attribute
+import org.apache.spark.sql.catalyst.trees.{CurrentOrigin, Origin}
 
-import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan
-import org.apache.spark.sql.catalyst.trees.{CurrentOrigin, Origin, WithOrigin}
 
 /**
  * Trait for all SQL Scripting logical operators that are product of parsing 
phase.
  * These operators will be used by the SQL Scripting interpreter to generate 
execution nodes.
  */
-sealed trait CompoundPlanStatement
+sealed trait CompoundPlanStatement extends LogicalPlan
 
 /**
  * Logical operator representing result of parsing a single SQL statement
  *   that is supposed to be executed against Spark.
  * @param parsedPlan Result of SQL statement parsing.
  */
 case class SingleStatement(parsedPlan: LogicalPlan)

Review Comment:
   Even though we can use `LogicalPlan` I would keep this abstraction to differ 
between SQL Scripts and allowed statements there and "normal" statements 
outside of script. There will be multiple iterations of refactoring so I would 
do a follow-up to remove this abstraction if it is really not needed.
   
   One place where it is being used is in `AbstractSqlParser` -> `parsePlan` 
method.



-- 
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]

Reply via email to