数据湖探索 DLI-OBS输出流:示例

时间:2024-07-01 21:07:18

示例

  • 将car_infos数据输出到OBS的obs-sink桶下,输出目录为car_infos, 输出文件以greater_30作为文件名前缀,当单个文件超过100M时新起一个文件,同时数据输出用csv编码,使用逗号作为属性分隔符,换行符作为行分隔符。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    CREATE SINK STREAM car_infos (
      car_id STRING,
      car_owner STRING,
      car_brand STRING,
      car_price INT,
      car_timestamp LONG
    )
      WITH (
        type = "obs",
        encode = "csv",
        region = "xxx",
        field_delimiter = ",",
        row_delimiter = "\n",
        obs_dir = "obs-sink/car_infos",
        file_prefix = "greater_30",
        rolling_size = "100m"
    );
    
  • orc编码格式示例
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    CREATE SINK STREAM car_infos (
      car_id STRING,
      car_owner STRING,
      car_brand STRING,
      car_price INT,
      car_timestamp LONG
    )
      WITH (
        type = "obs",
        region = "xxx",
        encode = "orc",
        obs_dir = "dli-append-2/obsorc",
        FILE_PREFIX = "es_info",
        max_record_num_per_file = "100000",
        dump_interval = "60"
    );
    
  • parquet编码示例请参考文件系统输出流(推荐)中的示例。
support.huaweicloud.com/sqlreference-dli/dli_08_0242.html