This topic describes the table_mapping and column_mapping properties.
table_mapping
If the name of a DLA table is different from the name of an underlying table, you can use the table_mapping property to specify the name of the underlying table.
For example, if the name of a DLA table is
person
and the name of an underlying table is staff
, you can execute the following statement to add the mapping between the two tables:create external table person (
id int,
name string,
age int
) tblproperties(
table_mapping = 'staff'
);
column_mapping
If column names in a DLA table are different from those in an underlying table or
the underlying table contains no columns, you can use the column_mapping property
to specify the column name mapping between the two tables. Example:
create external table person (
id int,
name string,
age int
) tblproperties(
column_mapping = 'id,identifier;name,title;'
);
Note In the preceding example, the
id
column in the DLA table maps to the identifier
column in the underlying table, and the name
column in the DLA table maps to the title
column in the underlying table. If you do not configure column mapping for the age
column in the DLA table, this column maps to the age
column in the underlying table.