viirya commented on a change in pull request #24051: [SPARK-26879][SQL] Zero 
based column indexing for struct function
URL: https://github.com/apache/spark/pull/24051#discussion_r264588131
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
 ##########
 @@ -272,7 +272,7 @@ object CreateStruct extends FunctionBuilder {
     CreateNamedStruct(children.zipWithIndex.flatMap {
       case (e: NamedExpression, _) if e.resolved => Seq(Literal(e.name), e)
       case (e: NamedExpression, _) => Seq(NamePlaceholder, e)
-      case (e, index) => Seq(Literal(s"col${index + 1}"), e)
+      case (e, index) => Seq(Literal(s"col$index"), e)
 
 Review comment:
   What functions are affected by this change? Only Inline function?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to