Reputation: 370
Can I create a Hive table from a sql/text file like we do in the case of MySQL and other RDBMSs. That is, store the "create table..." command in a .sql file and execute it in one go.
For eg. in MySQL I can do this
shell> mysql < sql_file
or if you are already running mysql,
mysql> source sql_file
1) Is there any such option in Hive
2) If yes, what would be the command and what would be the file extension
thanks
Upvotes: 0
Views: 2297
Reputation: 376
Upvotes: 0
Reputation: 546
You can use $HIVE_HOME/bin/hive -f /home/my/hive-script.sql from terminal. Refer to hive documentation link https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Cli .
Upvotes: 3