shrprasa commented on PR #40258:
URL: https://github.com/apache/spark/pull/40258#issuecomment-1461288036

   > Hm, how is it not ambiguous? When case insensitive, 'id' could mean one of 
two different columns
   
   It's not ambiguous because the  when we are selecting using list of column 
names, both id and ID are getting value from same column 'id' in the source 
dataframe. 
   val **df1** = 
sc.parallelize(List((1,2,3,4,5),(1,2,3,4,5))).toDF("**id"**,"col2","col3","col4",
 "col5")
   val op_cols_mixed_case = List(**"id"**,"col2","col3","col4", "col5", 
**"ID"**)
   val df3 = **df1**.select(op_cols_mixed_case.head, op_cols_mixed_case.tail: 
_*)
   df3.select("id").show()
   
   df3.explain()
   == Physical Plan ==
   *(1) Project [**_1#6 AS id#17**, _2#7 AS col2#18, _3#8 AS col3#19, _4#9 AS 
col4#20, _5#10 AS col5#21, **_1#6 AS ID#17**]


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