通用表属性
- table_mapping
当DLA里面的表名跟底层数据的表名不一致的时候,可以用property来指定底层数据的表名 。
举例:DLA的表名是 person,底层数据的表名是staff。
create external table person (
id int,
name string,
age int
) tblproperties(
table_mapping = 'staff'
);
- column_mapping
当DLA中的列名跟底层数据中的列名不一致的时候,或者底层数据中没有列的概念的时候,可以用property来指定底层数据列名与DLA列名的对应关系。
DLA的列名id 对应底层数据的identifier, name对应底层数据的title, 如果DLA中没有指定age ,则对应底层数据的age
create external table person (
id int,
name string,
age int
) tblproperties(
column_mapping = 'id,identifier;name,title;'
);