回覆列表
  • 1 # 何以笙丶丶

    Map使用

    建表:

    [plain] view plaincopy

    hive> create table employee(id string, perf map

    > ROW FORMAT DELIMITED

    > FIELDS TERMINATED BY "\t"

    > COLLECTION ITEMS TERMINATED BY ","

    > MAP KEYS TERMINATED BY ":";

    OK

    Time taken: 0.144 seconds

    ‘MAP KEYS TERMINATED BY’ :key value分隔符

    匯入資料:

    [plain] view plaincopy

    $ cat test7.txt

    1 job:80,team:60,person:70

    2 job:60,team:80

    3 job:90,team:70,person:100

    hive> LOAD DATA LOCAL INPATH "/home/work/data/test7.txt" INTO TABLE employee;

  • 中秋節和大豐收的關聯?
  • 8.7千瓦用多大的電線和空開?