Skip to main content

Datometry Documentation

Display Table Properties Using SHOW TABLE

The physical_props_in_show_table hint lets you display applicable hints related to the distribution and physical layout in SHOW TABLE output. The output returned by SHOW TABLE is the Data Definition Language (DDL) for the specified table. Using the information returned by SHOW TABLE, you can recreate a table in Azure Synapse using the exact same table definitions.

In the following example, we create a table and then use SHOW TABLE to display the distribution and physical layout properties with which it was created.

CREATE MULTISET TABLE  table_name
    -- @dtm_override_distribution_style=replicate
    -- @dtm_override_table_layout=clustered_index
    -- @dtm_override_table_layout_cols=col1,col2,col3,col4,col5,col6,col7,col8,col9
    -- @dtm_synapse_partitions_override=col1 RANGE LEFT FOR VALUES ('10','20')
    (
        col1 integer ,
        col2 integer ,
        col3 integer ,
        col4 integer ,
        col5 integer ,
        col6 integer ,
        col7 integer ,
        col8 integer ,
        col9 integer
    );

Below is the SHOW TABLE output generated when the Hyper-Q hint physical_props_in_show_table is enabled.

SHOW TABLE table_name;
CREATE MULTISET TABLE table_name
    -- @dtm_override_distribution_style=replicate
    -- @dtm_override_table_layout=clustered_index
    -- @dtm_override_table_layout_cols=col1,col2,col3,col4,col5,col6,col7,col8,col9
    -- @dtm_synapse_partitions_override=col1 RANGE LEFT FOR VALUES ('10','20')
    (
        col1 integer ,
        col2 integer ,
        col3 integer ,
        col4 integer ,
        col5 integer ,
        col6 integer ,
        col7 integer ,
        col8 integer ,
        col9 integer
    )
    NO PRIMARY INDEX
    INDEX ClusteredIndex_e7eb2ff0f7a7498dbf90ccbd78e273c3 ( col1 , col2 , col3 , col4 , col5 , col6 , col7 , col8 , col9 );

When you run SHOW TABLE, the output generated by Hyper-Q displays the embedded Hyper-Q hints for Azure Synapse distribution, layout, and partitioning of the native table on Azure Synapse that is created with the identical distribution, layout, and partitioning as the original table. The Teradata-specific properties are stored in the Hyper-Q Metadata Store and are identical to the original table on which the SHOW TABLE command was run.

The syntax for physical_props_in_show_table is:

physical_props_in_show_table = true | false

-or-

dtm set physical_props_in_show_table = on | off

where:

Parameter

Description

true

Enables Hyper-Q to use SHOW TABLE to display the distribution and physical layout of a table.

false

Disables the use of SHOW TABLE to display the distribution and physical layout of a table. This is the default behavior.

on

Enables Hyper-Q to use SHOW TABLE to display distribution and physical layout of a table using the dtm set command.

off

Disables the use of SHOW TABLE to display the table properties using the dtm set command.

Hint Scope

You can specify physical_props_in_show_table as an application (global) level setting in the Hyper-Q configuration file (dtm.ini ), as a Hyper-Q hint within a SQL query, or using the dtm set command.

Example 26. Specify that Hyper-Q use SHOW TABLE as a Global Setting

You can specify physical_props_in_show_table as an application level setting in the Hyper-Q configuration file (dtm.ini). To enable physical_props_in_show_table, set it to true. The default value is false.

"gateway".physical_props_in_show_table=true

To learn more about specifying a hint as a gateway option in the Hyper-Q configuration file, see Gateway Configuration Parameters.



Example 27. Specify that Hyper-Q use SHOW TABLE as a Query Hint

You can specify physical_props_in_show_table as a query hint at either the session or query level. This example specifies that the hint be used at the for session level within a CREATE TABLE statement.

CREATE TABLE
-- @dtm_physical_props_in_show_table=true for session;
table_name
-- @dtm_override_table_layout=clustered_index
-- @dtm_override_table_layout_cols=col1,col2
-- @dtm_override_distribution_style=replicate
        (
        column1 integer ,
        column2 integer ,
        column3 integer 
    );;

To learn more about Hyper-Q SQL hints, and how to use them within a SQL query, see About Hyper-Q SQL Hints.



Example 28. Specify that Hyper-Q use SHOW TABLE Using the DTM SET Command

You can enable and disable physical_props_in_show_table using the dtm set command interactively on a per session basis. When specifying the configuration using the dtm set command, use the options on | off to enable and disable displaying information returned by SHOW TABLE.

Using dtm set you can write a script to display table information using SHOW TABLE as necessary. When specifying an option using dtm set, it overrides the setting in the dtm.ini file, and will do so until you turn off physical_props_in_show_table.

dtm set physical_props_in_show_table on

CREATE TABLE table_name
-- @dtm_override_table_layout=clustered_index
-- @dtm_override_table_layout_cols=col1,col2
-- @dtm_override_distribution_style=replicate
        (
        column1 integer ,
        column2 integer ,
        column3 integer 
    );

SHOW TABLE
CREATE MULTISET TABLE table_name
    (
        column1 integer ,
        column2 integer ,
        column3 integer
    )
    NO PRIMARY INDEX
    INDEX ClusteredIndex_a08635b496f44fd9864a55def0e721c3 ( col1 , col2 )


dtm set physical_props_in_show_table off;

SHOW TABLE table_name;