Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19499#discussion_r155403790
  
    --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala 
---
    @@ -106,7 +106,7 @@ private[spark] object HiveUtils extends Logging {
         .doc("When set to true, the built-in ORC reader and writer are used to 
process " +
           "ORC tables created by using the HiveQL syntax, instead of Hive 
serde.")
         .booleanConf
    -    .createWithDefault(false)
    +    .createWithDefault(true)
    --- End diff --
    
    Yep. It's resolved via SPARK-14387. The following is a result from 2.2.1.
    ```sql
    hive> CREATE TABLE source(inv_date_sk INT, inv_item_sk INT, 
inv_warehouse_sk INT, inv_quantity_on_hand INT);
    hive> INSERT INTO source VALUES(1,1,1,1);
    hive> CREATE TABLE inventory(inv_date_sk INT, inv_item_sk INT, 
inv_warehouse_sk INT, inv_quantity_on_hand INT)
        > ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS ORC;
    hive> INSERT OVERWRITE TABLE inventory SELECT * FROM source;
    
    scala> sql("set spark.sql.hive.convertMetastoreOrc=true")
    scala> sql("SELECT * FROM inventory").show
    +-----------+-----------+----------------+--------------------+
    |inv_date_sk|inv_item_sk|inv_warehouse_sk|inv_quantity_on_hand|
    +-----------+-----------+----------------+--------------------+
    |          1|          1|               1|                   1|
    +-----------+-----------+----------------+--------------------+
    scala> spark.version
    res2: String = 2.2.1
    ```


---

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

Reply via email to