Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24096

create table as select not using hive.default.fileformat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.3.0
    • None
    • SQL
    • None

    Description

      In my spark conf directory, hive-site.xml have an item indicating orc is the default file format.

      <property>
      <name>hive.default.fileformat</name>
      <value>orc</value>
      </property>

       

      But when I use "create table as select ..." to create a table, the output format is plain text. 

      It works only I use "set hive.default.fileformat=orc"

       

      Then I walked through the spark code and found in 

      sparkSqlParser:visitCreateHiveTable(), 

      val defaultStorage = HiveSerDe.getDefaultStorage(conf)  the conf is SQLConf,

      that explains the above observation, 

      "set hive.default.fileformat=orc" is put into conf map, hive-site.xml is not. 

       

      It's quite misleading, How to unify the settings?

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              desmoon StephenZou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: