数据湖探索 DLI-Flink作业输出流写入数据到OBS,通过该OBS文件路径创建的DLI表查询无数据:问题现象

时间:2024-11-06 21:53:31

问题现象

使用Flink作业输出流写入数据到了OBS中,通过该OBS文件路径创建的 DLI 表进行数据查询时,无法查询到数据。

例如,使用如下Flink结果表将数据写入到OBS的“obs://obs-sink/car_infos”路径下。

create sink stream car_infos_sink (
  carId string,
  carOwner string,
  average_speed double,
  buyday string
  ) partitioned by (buyday)
  with (
    type = "filesystem",
    file.path = "obs://obs-sink/car_infos",
    encode = "parquet",
    ak = "{{myAk}}",
    sk = "{{mySk}}"
);
通过该OBS文件路径创建DLI分区表,在DLI查询car_infos表数据时没有查询到数据。
create table car_infos (
  carId string,
  carOwner string,
  average_speed double
)
  partitioned by (buyday string)
  stored as parquet
  location 'obs://obs-sink/car_infos';
support.huaweicloud.com/dli_faq/dli_03_0168.html