Documentation
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Replace Tables

The REPLACE_TABLES Pre-hook can rewrite the submitted query, replacing the tables which are referenced in the query with different tables which are specified in the hook definition.

Configuration Syntax

  {
    'Tables':
    [{
        'From': <from>,
        'To': <to>
    }]
  }

Arguments

<from>
The table name to replace
<to>
The table name to replace with

Usage Notes

  • If none of the from table name(s) match any tables, the hook has no impact on the query.

Examples

CREATE SUNDECK FLOW REPLACE_PROD_WITH_TEST
    PRE HOOK REPLACE
    ALWAYS
    REPLACE_TABLES
      { 'Tables': [
          {'From': 'PROD.S.CUSTOMERS', 'To': 'TEST.S.MY_CUSTOMERS'}
        ]
      }
;

This will replace all references to the PROD.S.CUSTOMERS table with the TEST.S.MY_CUSTOMERS table