Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31936 Implement ScriptTransform in sql/core
  3. SPARK-32388

TRANSFORM when schema less should keep same with hive

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.1.0
    • SQL
    • None

    Description

      Hive transform without schema

       

      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

      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   11
      2   22 

       

      Attachments

        Activity

          People

            angerszhuuu angerszhu
            angerszhuuu angerszhu
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: