MCPcopy Create free account
hub / github.com/apache/impala / build_insert

Function build_insert

testdata/bin/generate-schema-statements.py:639–658  ·  view source on GitHub ↗
(insert, db_name, db_suffix, file_format,
                 codec, compression_type, table_name, hdfs_path, create_hive=False,
                 for_impala=False, scale_factor="")

Source from the content-addressed store, hash-verified

637
638
639def 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
661def build_load_statement(load_template, db_name, db_suffix, table_name, scale_factor=""):

Callers 1

generate_statementsFunction · 0.85

Tested by

no test coverage detected