First look at the help command for hive:
[[email protected] hive]$ hive-hmissing argument for option:husage:hive-d,--define <key=value> Va Riable subsitution to the Apply to hive commands. e.g.-D a=b or--define a=b--database <databasename> Specify the database to Use-e <quoted-query-string& Gt SQL from command line-f <filename> SQL from files-h,--help Print Help in Formation-h
To increase table partitioning for hive tables using crontab timing:
Method 1:
-e <quoted-query-string> SQL from command line
Execute command:
[[email protected] hive]$ hive--database gcld-e ' ALTER TABLE Gcldlog add partition (dt=\\ ' 2015-06-14\\ ') location \ \ ' 2015-06-14\\ ';
Logging initialized using configuration in File:/etc/hive/conf.dist/hive-log4j.properties
Ok
Time taken:1.097 seconds
Method 2:
-I <filename> initialization SQL file
Edit the SQL command:
ALTER TABLE Gcldlog Add partition (dt= ' 2015-06-10 ') location ' 2015-06-10 ';
Exit; (Remember to add the Exit command)
Execute command:
Hive--database gcld-i/script/gcld/test.sql;
This enables the shell to dynamically add partitioned tables to the Hive table.
Shell creates hive table partition periodically