您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

.create ingestion mapping.create ingestion mapping

创建与特定表和特定格式相关联的引入映射。Creates an ingestion mapping that is associated with a specific table and a specific format.

语法Syntax

.create``table TableName ingestion MappingKind mapping MappingName MappingFormattedAsJson.create table TableName ingestion MappingKind mapping MappingName MappingFormattedAsJson

备注

  • 创建后,可在引入命令中按名称引用映射,而不是将完整映射指定为命令的一部分。Once created, the mapping can be referenced by its name in ingestion commands, instead of specifying the complete mapping as part of the command.
  • _MappingKind_的有效值为: CSVJSONavroparquetorcValid values for MappingKind are: CSV, JSON, avro, parquet, and orc
  • 如果表中已存在具有相同名称的映射:If a mapping by the same name already exists for the table:
    • .create将失败.create will fail
    • .create-or-alter将改变现有映射.create-or-alter will alter the existing mapping

示例Example

.create table MyTable ingestion csv mapping "Mapping1"
'['
'   { "column" : "rownumber", "DataType":"int", "Properties":{"Ordinal":"0"}},'
'   { "column" : "rowguid", "DataType":"string", "Properties":{"Ordinal":"1"}}'
']'

.create-or-alter table MyTable ingestion json mapping "Mapping1"
'['
'    { "column" : "rownumber", "datatype" : "int", "Properties":{"Path":"$.rownumber"}},'
'    { "column" : "rowguid", "Properties":{"Path":"$.rowguid"}}'
']'

示例输出Example output

名称Name 种类Kind 映射Mapping
mapping1mapping1 CSVCSV [{"Name":"rownumber","DataType":"int","CsvDataType":null,"Ordinal":0,"ConstValue":null},{"Name":"rowguid","DataType":"string","CsvDataType":null,"Ordinal":1,"ConstValue":null}]

后续步骤Next steps

有关引入映射的详细信息,请参阅数据映射For more information about ingestion mapping, see Data mappings.