| 143 | return success |
| 144 | |
| 145 | def exec_hive_query_from_file_beeline(file_name): |
| 146 | if not os.path.exists(file_name): |
| 147 | LOG.info("Error: File {0} not found".format(file_name)) |
| 148 | return False |
| 149 | |
| 150 | LOG.info("Beginning execution of hive SQL: {0}".format(file_name)) |
| 151 | |
| 152 | output_file = file_name + ".log" |
| 153 | hive_cmd = "{0} {1} -f {2}".format(HIVE_CMD, HIVE_ARGS, file_name) |
| 154 | is_success = exec_cmd(hive_cmd, exit_on_error=False, out_file=output_file) |
| 155 | |
| 156 | if is_success: |
| 157 | LOG.info("Finished execution of hive SQL: {0}".format(file_name)) |
| 158 | else: |
| 159 | LOG.info("Error executing hive SQL: {0} See: {1}".format(file_name, \ |
| 160 | output_file)) |
| 161 | |
| 162 | return is_success |
| 163 | |
| 164 | |
| 165 | def exec_hbase_query_from_file(file_name, step_name): |