hive json

516 ワード

hive jsonデータを直接アップロード
  • テーブルを構築し、jsonフォーマットを受信するテーブル
  • を確立する.
  • jsonフォーマットデータ
  • を準備する
    //        jar ,    ,       
    add jar /xxxl/hive-hcatalog-core-0.14.0.jar;
    //       json table
    create table db.table(
    name string,
    age string
     )
     ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
    STORED AS TEXTFILE;
    //   json  
    load  data local inpath '/xx.json' into table db.table;
    

    注意:
  • このフィールドがない場合はnull
  • がデフォルトです.
  • add jarが間違っている場合は、現在のウィンドウを閉じて
  • を再開します.