MAPREDUCE服务 MRS-CREATE TABLE:示例

时间:2024-11-28 01:44:37

示例

  • 创建非分区表
    create table if not exists hudi_table0 (
    id int,
    name string,
    price double
    ) using hudi
    options (
    type = 'cow',
    primaryKey = 'id',
    preCombineField = 'price'
    );
  • 创建分区表
    create table if not exists hudi_table_p0 (
    id bigint,
    name string,
    ts bigint,
    dt string,
    hh string
    ) using hudi
    options (
    type = 'cow',
    primaryKey = 'id',
    preCombineField = 'ts'
    )
    partitioned by (dt, hh);
  • 在指定路径下创建表
    create table if not exists h3(
    id bigint,
    name string,
    price double
    ) using hudi
    
    options (
    primaryKey = 'id',
    preCombineField = 'price'
    )
    location '/path/to/hudi/h3';
support.huaweicloud.com/cmpntguide-lts-mrs/mrs_01_24264.html