云服务器内容精选

  • 示例 创建非分区表 create table if not exists hudi_table0 (id int,name string,price double) using hudioptions (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 hudioptions (type = 'cow',primaryKey = 'id',preCombineField = 'ts')partitioned by (dt, hh); 在指定路径下创建表 create table if not exists h3(id bigint,name string,price double) using hudioptions (primaryKey = 'id',preCombineField = 'price')location 'obs://bucket/path/to/hudi/h3';
  • 参数描述 表1 CREATE TABLE参数描述 参数 描述 database_name Database名称,由字母、数字和下划线(_)组成。 table_name Database中的表名,由字母、数字和下划线(_)组成。 columnTypeList 以逗号分隔的带数据类型的列表。列名由字母、数字和下划线(_)组成。 using 参数hudi,定义和创建Hudi table。 table_comment 表的描述信息。 location_path OBS路径,指定该路径Hudi 表会创建为外表。 options_list Hudi table属性列表。
  • 注意事项 Hudi当前不支持使用char、varchar、tinyint、smallint类型,建议使用string或int类型。 Hudi当前只有int、bigint、float、double、decimal、string、date、timestamp、boolean、binary类型支持设置默认值。 Hudi表必须指定primaryKey与preCombineField。 在指定路径下创建表时,如果路径下已存在Hudi表,则建表时不需要指定列,且不能修改表的原有属性。