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

Function build_replacement_params

testdata/bin/generate-schema-statements.py:252–274  ·  view source on GitHub ↗

Create a variable:value map for SQL replacement based on given parameters. db_name, db_suffix, and table_name is mandatory. Others are optional.

(
    db_name, db_suffix, table_name, hdfs_location=None, impala_home=None,
    hint=None, part_predicate=None, file_format=None, scale_factor=None)

Source from the content-addressed store, hash-verified

250
251
252def build_replacement_params(
253 db_name, db_suffix, table_name, hdfs_location=None, impala_home=None,
254 hint=None, part_predicate=None, file_format=None, scale_factor=None):
255 """Create a variable:value map for SQL replacement based on given parameters.
256 db_name, db_suffix, and table_name is mandatory. Others are optional."""
257 params = {
258 VAR_DB_NAME: db_name,
259 VAR_DB_SUFFIX: db_suffix,
260 VAR_TABLE_NAME: table_name
261 }
262 if hdfs_location is not None:
263 params[VAR_HDFS_LOCATION] = hdfs_location
264 if impala_home is not None:
265 params[VAR_IMPALA_HOME] = impala_home
266 if hint is not None:
267 params[VAR_HINT] = hint
268 if part_predicate is not None:
269 params[VAR_PART_PREDICATE] = part_predicate
270 if file_format is not None:
271 params[VAR_FILE_FORMAT] = file_format
272 if scale_factor is not None:
273 params[VAR_SCALE_FACTOR] = scale_factor
274 return params
275
276
277def build_create_statement(table_template, table_name, db_name, db_suffix,

Callers 4

build_create_statementFunction · 0.85
build_hbase_insertFunction · 0.85
build_load_statementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected