【问题标题】:like operater not working on hive,what to do?像操作员不在蜂巢上工作,该怎么办?
【发布时间】:2017-11-17 07:13:34
【问题描述】:

select * from cancel where deduction_percentage like '%100% cancel fee%';

SemanticException [错误 10014]:第 1:27 行错误的参数“%100% 取消费用%”:类 org.apache.hadoop.hive.ql.udf.UDF 没有匹配方法与(数组,字符串)类似.可能的选择:FUNC(string, string)

【问题讨论】:

  • 异常表明deduction_percentage 是一个数组。 like 适用于字符串。使用 concat_ws 或使用 array_contains(Array, value) 函数连接数组。或者使用[]比较数组元素

标签: hive hiveql


【解决方案1】:

您的 deduction_percentage 看起来像数组数据类型。您编写的查询仅适用于字符串数据类型字段。

select * from cancel where concat_ws(',',deduction_percentage) like '%100% cancellation charge%';

【讨论】:

  • 这是我得到的... hive> select * from cancel where concat_ws(',',deduction_percentage) like '%100% cancel fee%'; OK 耗时:0.095 秒 hive>
猜你喜欢
  • 1970-01-01
  • 2014-08-24
  • 1970-01-01
  • 2020-10-15
  • 2014-11-03
  • 2019-02-07
  • 2019-07-04
  • 2011-06-28
  • 1970-01-01
相关资源
最近更新 更多