Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Insert csv file to Hadoop Hive table

  1. #1
    Join Date
    Oct 2011
    Posts
    23

    Default Insert csv file to Hadoop Hive table

    Hi All,

    I have tried new things on PDI 4.2, that is hive step.
    i have successfully put some file to HDFS from PDI whit Hadoop Output Step.Now i want to export CSV file to Hive Table,

    i have try to connected CSV file input to Hadoop File Output step, but my file csv only on HDFS, i want to it generated automatically on HIve Table as when i exporting CSV file to Mysql Table.

    How i can get it ?



    Thanks,

  2. #2

    Default

    Hi Firantika,

    Have you set up the Hive table upfront? Hive tables definitions can not be generated automatically. You first need to create the hive table on the Hadoop cluster.

    Example:
    From the Hive command line interface:

    CREATE EXTERNAL TABLE some_table (City STRING, Neighborhood STRING, Inhabitants INT)
    ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
    LOCATION '/user/firantika/hive/some_table'
    STORED AS TEXTFILE;

    This is for a tab seperated file.

    If you add files in HDFS to '/user/firantika/hive/some_table/' your some_table will automatically be populated. Everything you put into this folder will be 'added to the table'. In the end Hive just presents the contents of HDFS folder as table. But under the hood these are just HDFS files.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.