V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
jiaqidianbo
V2EX  ›  问与答

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

  •  
  •   jiaqidianbo · Nov 12, 2015 · 3124 views
    This topic created in 3827 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
        1
    junphe  
       Nov 12, 2015
    在 SQL 前加: set hive.cli.print.header=false;
    hive -e "set hive.cli.print.header=false;SELECT * FROM temp.temp_training" > training.txt
    junphe
        2
    junphe  
       Nov 12, 2015
    @jiaqidianbo 看成不包含了,包含应该 set hive.cli.print.header=true;
    jiaqidianbo
        3
    jiaqidianbo  
    OP
       Nov 12, 2015
    @junphe 谢谢,成功了,但是第一行每个字段都包含了文件名 temp_training ,比如 temp_training.y_85 ,而我实际上数据库中表的只有 y_85
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2671 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 12:01 · PVG 20:01 · LAX 05:01 · JFK 08:01
    ♥ Do have faith in what you're doing.