Skip to main content
export_records_to_table(table_name=None, remote_query=, options=)[source]

Exports records from source table to the specified target table in an external database.

Parameters

table_name (str) –

Name of the table from which the data will be exported to remote database, in [schema_name.]table_name format, using standard name resolution rules.

remote_query (str) –

Parameterized insert query to export gpudb table data into remote database. The default value is ‘’.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • batch_size – Batch size, which determines how many rows to export per round trip. The default value is ‘200000’.

  • datasink_name – Name of an existing external data sink to which table name specified in input parameter table_name will be exported.

  • jdbc_session_init_statement – Executes the statement per each JDBC session before doing actual load. The default value is ‘’.

  • jdbc_connection_init_statement – Executes the statement once before doing actual load. The default value is ‘’.

  • remote_table – Name of the target table to which source table is exported. When this option is specified remote_query cannot be specified. The default value is ‘’.

  • use_st_geomfrom_casts – Wraps parameterized variables with st_geomfromtext or st_geomfromwkb based on source column type. Allowed values are:

    • true

    • false

    The default value is ‘false’.

  • use_indexed_parameters – Uses $n style syntax when generating insert query for remote_table option. Allowed values are:

    • true

    • false

    The default value is ‘false’.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

table_name (str) –

Value of input parameter table_name.

count_inserted (long) –

Number of records inserted into the target table.

count_skipped (long) –

Number of records skipped.

count_updated (long) –

[Not yet implemented] Number of records updated within the target table.

info (dict of str to str) –

Additional information.