ottomata commented on issue #21012: [SPARK-23890][SQL] Support CHANGE COLUMN to 
add nested fields to structs
URL: https://github.com/apache/spark/pull/21012#issuecomment-474054663
 
 
   @gatorsmile, I just verified that this works for ORC too:
   
   ```sql
   > CREATE TABLE orc0 (
     name string,
     val int,
     s struct<v1:string>
   ) STORED AS ORC;
   
   > insert into table orc0 select "a", 1, named_struct("v1", "V1");
   
   > select * from orc0;
   name    val s
   a   1   {"v1":"V1"}
   
   > alter table orc0 change column s s struct<v1:string,v2:string>;
   
   > select * from orc0;
   name    val s
   a   1   {"v1":"V1","v2":null}
   
   > insert into table orc0 select "a", 1, named_struct("v1", "V1", "v2", "V2");
   
   > select * from orc0;
   name    val s
   a   1   {"v1":"V1","v2":null}
   a   1   {"v1":"V1","v2":"V2"}
   ```
   
   This was using Hive 1.1.0.
   

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