hivesql可运行的sql 在spark上运行报错如下

Error in query: cannot resolve 'coalesce(d.`subarea_duration_l30`, map(NULL, NULL))' due to data type mismatch: input to function coalesce should all be the same type, but it's [map<string,string>, map<null,null>]; line 17 pos 2;

hivesql语句部分如下

  NVL(subarea_num_l30, 0) subarea_num_l30,
  NVL(subarea_duration_l30, MAP(null, null)) subarea_duration_l30,
  NVL(anchor_num_l30, 0) achor_num_l30,
  NVL(day_num_l30, 0) day_num_l30,
  NVL(avg_hour_duration_l30, MAP(null, null)) avg_hour_duration_l30,
  NVL(watch_count_l90, 0) watch_count_l90,
  NVL(watch_duration_l90, 0) watch_duration_l90,
  IF(
    NVL(watch_count_l90, 0) = 0,

解决方法:

将Map(null,null)改为Map()即可

 

相关文章:

  • 2021-06-20
  • 2022-01-19
  • 2021-07-28
  • 2022-12-23
  • 2021-09-26
  • 2021-10-04
  • 2021-12-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案