Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-1603

support CSV text file format

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 0.7.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Comma Separated Values (CSV) text format are commonly used in exchanging relational data between heterogeneous systems. Currently Hive uses TextFile format when displaying query results. This could cause confusions when column values contain new lines or tabs. A CSVTextFile format could get around this problem. This will require a new CSVTextInputFormat, CSVTextOutputFormat, and CSVSerDe.

      A proposed use case is like:

      -- exporting a table to CSV files in a directory
      hive> set hive.io.output.fileformat=CSVTextFile;
      hive> insert overwrite local directory '/tmp/CSVrepos/' select * from S where ... ;
      
      -- query result in CSV
      hive -e 'set hive.io.output.fileformat=CSVTextFile; select * from T;' | sql_loader_to_other_systems
      
      -- query CSV files directory from Hive
      hive> create table T (...) stored as CSVTextFile;
      hive> load data local inpath '/my/CSVfiles' into table T;
      hive> select * from T where ...;
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nzhang Ning Zhang
              • Votes:
                4 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: