jiaqidianbo
V2EX  ›  问与答

hive -e 导出文件要包含 title 怎么做

  •  
  •   jiaqidianbo · Nov 12, 2015 · 3508 views
    This topic created in 4038 days ago, the information mentioned may be changed or developed.

    hive -e "SELECT * FROM temp.temp_training" > training.txt

    导出的文件第一行不包含 title 怎么办?

    3 replies  •  2015-11-12 14:25:34 +08:00
    junphe
    junphe
    Nov 12, 2015
    1
    在 SQL 前加: set hive.cli.print.header=false;
    hive -e "set hive.cli.print.header=false;SELECT * FROM temp.temp_training" > training.txt
    junphe
    junphe
    Nov 12, 2015
    2
    @jiaqidianbo 看成不包含了,包含应该 set hive.cli.print.header=true;
    jiaqidianbo
    jiaqidianbo
    OP
    Nov 12, 2015
    3
    @junphe 谢谢,成功了,但是第一行每个字段都包含了文件名 temp_training ,比如 temp_training.y_85 ,而我实际上数据库中表的只有 y_85
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1860 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 15:48 · PVG 23:48 · LAX 07:48 · JFK 10:48
    ♥ Do have faith in what you're doing.