I am trying to get the header info of a hive table to dynamically make a partitioned Hive table later.
Running the below code freezes the system: Python 2...
What is going wrong, I am new to python.
def get_final_table_columns_file():
logger.info("========================================================================================")
logger.info("Executing Hive DDL to get Final Hive Table Columns")
column_grab_cmd = []
column_grab_cmd.append(os.environ['HIVE_HOME'] + '/bin/hive')
column_grab_cmd.append('-S')
column_grab_cmd.append('-e')
column_grab_cmd.append('\"SET hive.cli.print.header=true;')
column_grab_cmd.append('USE '+hive_db_name+ '; SELECT * FROM '+ staging_table_name +' LIMIT 0;\"')
printArray(column_grab_cmd)
column_grab_cmd_process = subprocess.call(column_grab_cmd,stdout=subprocess.PIPE, shell=True)
(output, err) = column_grab_cmd_process.communicate()
success_message = "Execution of Hive DDL to grab headers succeed: \\n" + output
logger.info(success_message)