amaliujia commented on code in PR #38631:
URL: https://github.com/apache/spark/pull/38631#discussion_r1020563219


##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -334,7 +334,11 @@ class SparkConnectPlanner(session: SparkSession) {
   }
 
   private def transformAlias(alias: proto.Expression.Alias): NamedExpression = 
{
-    Alias(transformExpression(alias.getExpr), alias.getName)()
+    if (alias.getNameCount == 1) {
+      Alias(transformExpression(alias.getExpr), alias.getName(0))()
+    } else {
+      MultiAlias(transformExpression(alias.getExpr), 
alias.getNameList.asScala.toSeq)

Review Comment:
   I actually expect Scala client will re-use Connect DSL. 
   
   if you take a closer look, Connect DSL is DataFrame like internal API that 
offers `toProto` logic (equivalent to `plan.py` for python). 
   
   Anything adding to the DSL will not only help testing coverage but also help 
Scala client potentially.  



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

Reply via email to