hive - Hive 1.1.0 中的解码功能失败
问题描述
我尝试在配置单元 1.1.0 中使用解码函数执行转换。但它抛出错误。我已经从配置单元函数中引用了语法,但我仍然从解码函数中得到错误。总是我得到
SemanticException Decode() 恰好需要两个参数
hive> select * from tbl_test;
OK
1 aaaa
2 bbbb
3 cccc
4 dddd
Time taken: 0.12 seconds, Fetched: 4 row(s)
hive> select decode(col1,1,'hi','hello') from tbl_test;
FAILED: SemanticException [Error 10015]: Line 1:7 Arguments length mismatch ''hello'': Decode() 需要两个参数
hive> select decode(col1,1,'hi',null) from tbl_test;
失败:语义异常 [错误 10015]:第 1:7 行参数长度不匹配“TOK_NULL”:解码()恰好需要两个参数
hive> select decode(col1,1,'hi') from tbl_test;
FAILED: SemanticException [Error 10015]: Line 1:7 Arguments length mismatch ''hi'': Decode() 需要两个参数
hive> select decode(col1,1,'hi',"hello") from tbl_test;
FAILED: SemanticException [Error 10015]: Line 1:7 Arguments length mismatch '"hello"': Decode() 需要两个参数
解决方案
推荐阅读
- laravel - 某些地址的 nginx 自定义根
- linux - chmod ugo+rwx 不允许操作
- python - TensorFlow 2.0-GPU Windows 正在 CPU 上运行训练代码
- angular - Angular Mat-form-field 占位符颜色
- opengl - 为什么将顶点着色器输入中的值复制到顶点着色器(平面)输出会产生不同的值?
- python - 在 Python 中解析 json 字符串
- c++ - 使用 C++ 进行“非侵入式”翻译?
- react-native - react-native-navigation 中的导航器
- java - Spring Cacheable 除非条件不起作用
- angular - 重用 Angular 8 响应式表单来创建/更新产品