(insert, db_name, db_suffix, file_format,
codec, compression_type, table_name, hdfs_path, create_hive=False,
for_impala=False, scale_factor="")
| 637 | |
| 638 | |
| 639 | def build_insert(insert, db_name, db_suffix, file_format, |
| 640 | codec, compression_type, table_name, hdfs_path, create_hive=False, |
| 641 | for_impala=False, scale_factor=""): |
| 642 | # HBASE inserts don't need the hive options to be set, and don't require and HDFS |
| 643 | # file location, so they're handled separately. |
| 644 | if file_format == 'hbase' and not create_hive: |
| 645 | return build_hbase_insert(db_name, db_suffix, table_name) |
| 646 | output = '' |
| 647 | if not for_impala: |
| 648 | # If this is not for Impala, then generate the hive codec statements |
| 649 | output += build_codec_enabled_statement(codec) + "\n" |
| 650 | output += build_compression_codec_statement(codec, compression_type, |
| 651 | file_format) + "\n" |
| 652 | elif file_format == 'parquet' or is_iceberg_table(file_format): |
| 653 | # This is for Impala parquet, add the appropriate codec statement |
| 654 | output += build_impala_parquet_codec_statement(codec) + "\n" |
| 655 | output += build_insert_into_statement(insert, db_name, db_suffix, |
| 656 | table_name, file_format, hdfs_path, |
| 657 | for_impala, scale_factor) + "\n" |
| 658 | return output |
| 659 | |
| 660 | |
| 661 | def build_load_statement(load_template, db_name, db_suffix, table_name, scale_factor=""): |
no test coverage detected