これらのプロシージャはreplication and materializationに関するものです。
SYSADMIN.batchUpdate
SYSADMIN.batchUpdate(
IN
dwh_table string,
IN
source_table string,
IN
identity_expression string)
以下のパラメータを取ります:
Parameter | Description |
---|---|
| Arbitrary name of the history table in the data warehouse |
| Table name in the source |
| 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 |
---|---|
| Arbitrary name of the history table in the data warehouse |
| Table name in the source |
| Defined as an object, but this is actually an array containing the keys in the source table |
| 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 |
---|---|
| Target table schema and name |
| Source table schema and name |
| Alter column template; optional. If not specified, the default value is used (default: PostgreSQL) |
異なるDBMSには、異なるalterColumnTemplate
フォーマットがあります:
DBMS | |
---|---|
Microsoft SQL Server | |
MySQL | |
Oracle | |
Snowflake | |
Vertica | |
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
非推奨