これらのプロシージャはreplication and materializationに関するものです。

SYSADMIN.batchUpdate

SYSADMIN.batchUpdate(IN dwh_table string, IN source_table string, IN identity_expression string)

以下のパラメータを取ります:

Parameter

Description

dwh_table

Arbitrary name of the history table in the data warehouse

source_table

Table name in the source

identity_expression

Identity field name or identity expression in SQL used to determine whether existing data should be corrected in the Analytical Storage

Example

CALL SYSADMIN.BatchUpdate('"dwh"."batchtest"', '"test_tables_or"."salesperson"', 'SALESPERSONID')

SYSADMIN.historyUpdate

このシステムプロシージャは、履歴テーブルで追加 / 変更されたレコード数(つまり、追加 / 編集 / 削除されたソース内のレコードの総数)を返します。

SYSADMIN.historyUpdate(IN dwh_table string, IN source_table string, IN keyColumnsArray object, IN columnsToCheckArray object)

以下のパラメータを取ります:

Parameter

Description

dwh_table

Arbitrary name of the history table in the data warehouse

source_table

Table name in the source

keyColumnsArray

Defined as an object, but this is actually an array containing the keys in the source table

columnsToCheckArray

Array containing the columns to be checked if something has changed

Example

CALL SYSADMIN.historyUpdate('dwh.historyUpdateSCD2', 'my_ds.scd2',array('Supplier_Key_1', 'Supplier_Key_2'), array('Supplier_State', 'Supplier_Name')) ;;

SYSADMIN.getReplicatedTableDiff

このプロシージャは、ALTER COLUMNクエリを作成し、ネイティブクエリとしてターゲットテーブル上で実行するか、ソースDBMSで直接実行し、ソーステーブルに適合させます。

SYSADMIN.getReplicatedTableDiff(IN targetTable string NOT NULL, IN sourceTable string NOT NULL, IN alterColumnTemplate string, OUT alterQuery string)

以下のパラメータを取ります:

Parameter

Description

targetTable

Target table schema and name

sourceTable

Source table schema and name

alterColumnTemplate

Alter column template; optional. If not specified, the default value is used (default: PostgreSQL)

異なるDBMSには、異なるalterColumnTemplateフォーマットがあります:

DBMS

alterColumnTemplate format

Microsoft SQL Server

ALTER TABLE %s ALTER COLUMN %s %s

MySQL

ALTER TABLE %s MODIFY %s %s

Oracle

ALTER TABLE %s MODIFY ("%s" %s

Snowflake

ALTER TABLE %s ALTER COLUMN "%s" SET DATA TYPE %s

Vertica

ALTER TABLE %s ALTER COLUMN "%s" SET DATA TYPE %s

Example

BEGIN
LOOP ON (SELECT * FROM (CALL SYSADMIN.getReplicatedTableDiff('dwh.target_table_name', 'ds.source_table_name')) AS z) AS cc
BEGIN
CALL dwh.native(cc.alterQuery);
END
END ;;
CALL SYSADMIN.refreshDataSource('dwh') ;;

SYSADMIN.refreshMatView

非推奨

SYSADMIN.refreshMatViewRow

非推奨