AngersZhuuuu opened a new pull request #29421:
URL: https://github.com/apache/spark/pull/29421


   ### What changes were proposed in this pull request?
   In current Spark script transformation with hive serde mode, in case of 
schema less, result is different with hive.
   This pr to keep result same with hive script transform  serde.
   
   #### Hive Scrip Transform with serde in schemaless
   ```
   hive> create table t (c0 int, c1 int, c2 int);
   hive> INSERT INTO t VALUES (1, 1, 1);
   hive> INSERT INTO t VALUES (2, 2, 2);
   hive> CREATE VIEW v AS SELECT TRANSFORM(c0, c1, c2) USING 'cat' FROM t;
   
   hive> DESCRIBE v;
   key                  string                                      
   value                string                                      
   
   hive> SELECT * FROM v;
   1    1       1
   2    2       2
   
   hive> SELECT key FROM v;
   1
   2
   
   hive> SELECT value FROM v;
   1    1
   2    2
   ```
   
   #### Spark script transform with hive serde in schema less.
   ```
   hive> create table t (c0 int, c1 int, c2 int); 
   hive> INSERT INTO t VALUES (1, 1, 1); 
   hive> INSERT INTO t VALUES (2, 2, 2); 
   hive> CREATE VIEW v AS SELECT TRANSFORM(c0, c1, c2) USING 'cat' FROM t; 
   
   hive> SELECT * FROM v; 
   1   1
   2   2
   ```
   
   **No serde mode in hive (ROW FORMATTED DELIMITED)**
   
![image](https://user-images.githubusercontent.com/46485123/90088770-55841e00-dd52-11ea-92dd-7fe52d93f0b3.png)
   
   ### Why are the changes needed?
   Keep same behavior with hive script transform
   
   
   ### Does this PR introduce _any_ user-facing change?
   Before this pr with hive serde script transform 
   ```
   select transform(*) 
   USING 'cat'
   from (
   select 1, 2, 3, 4 
   ) tmp
   
   key     value 
   1         2
   ```
   After 
   ```
   select transform(*) 
   USING 'cat'
   from (
   select 1, 2, 3, 4 
   ) tmp
   
   key     value 
   1         2   3  4
   ```
   ### How was this patch tested?
   UT
   


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



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

Reply via email to