jashgala commented on issue #23748: [SPARK-23619][SQL] Added default column 
names for explode & posexplode in comments
URL: https://github.com/apache/spark/pull/23748#issuecomment-462843580
 
 
   @maropu @HyukjinKwon 
   
   While looking at the default column names used by inline and stack, I found 
that inline uses col1, col2, etc. (i.e. 1-indexed columns), while stack uses 
col0, col1, col2, etc. (i.e. 0-indexed columns).
   
   ```
   scala> spark.sql("SELECT stack(2, 1, 2, 3)").show
   +----+----+
   |col0|col1|
   +----+----+
   |   1|   2|
   |   3|null|
   +----+----+
   
   
   scala>  spark.sql("SELECT inline_outer(array(struct(1, 'a'), struct(2, 
'b')))").show
   +----+----+
   |col1|col2|
   +----+----+
   |   1|   a|
   |   2|   b|
   +----+----+
   ```
   
   This feels like an issue with consistency. Is there a reason why this column 
naming convention is kept different?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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