Skip to content

Instantly share code, notes, and snippets.

@vithalsamp
Created February 25, 2018 12:08
Show Gist options
  • Save vithalsamp/26376f6431b7277b53d20c920e8e6d21 to your computer and use it in GitHub Desktop.
Save vithalsamp/26376f6431b7277b53d20c920e8e6d21 to your computer and use it in GitHub Desktop.
$ beeline -u jdbc:hive2://192.168.0.41:10000/test_db -n username -p password --hivevar dep_id=200 -f test_file.sql
Connecting to jdbc:hive2://192.168.0.41:10000/test_db
Connected to: Apache Hive (version 1.2.1000.2.5.0.0-1245)
Driver: Hive JDBC (version 1.2.1000.2.5.0.0-1245)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://192.168.0.41:10000/test_db_> select * from test_db.var_sub_demo
0: jdbc:hive2://192.168.0.41:10000/test_db_> where dept = ${dep_id}
0: jdbc:hive2://192.168.0.41:10000/test_db_> +------------------+--------------------+--------------------+--+
| var_sub_demo.id | var_sub_demo.name | var_sub_demo.dept |
+------------------+--------------------+--------------------+--+
| 2 | BCD | 200 |
| 3 | CDE | 200 |
+------------------+--------------------+--------------------+--+
2 rows selected (0.155 seconds)
0: jdbc:hive2://192.168.0.41:10000/test_db_>
Closing: 0: jdbc:hive2://192.168.0.41:10000/test_db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment