Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Initialize schema
- # schematool –dbType <db_type> -initSchema
- To start Hive server (note that we don’t do it in our virtual machines, skip to Hive CLI)
- # hiveserver2 &
- It will start Hive server. As we configured metastore as local, it will also instantiate a Derby instance for metastore
- # ls /root/opt/data/hive/metastore_db
- Hive CLI
- Start Hive CLI
- # hive
- hive >
- Hive 2 uses Beeline as CLI
- # beeline –u jdbc:hive2://localhost:10000
- 0: jdbc:hive2://localhost:10000>
- Silent mode
- # hive -S -e "SELECT * FROM mytable"
- something
- Output to file
- # hive -S -e "SELECT * FROM mytable" > output.txt
- # cat output.txt
- Run query from file
- # hive -S -f /path/to/hive.sql
- something
Add Comment
Please, Sign In to add comment