hiveql - 无论如何将逗号分隔的字符串加载到配置单元中的单个列中?
问题描述
“插入/值不支持 TOK_STRINGLITERALSEQUENCE”在将数据加载到配置单元时出现此错误。
当尝试将逗号分隔的字符串插入单个列时,它显示错误为
'插入/值不支持 TOK_STRINGLITERALSEQUENCE'
insert into table table_name values('llu'/t'ghf'/t'a,b,c,d'/t'gh,edf,ghu,kjhl'/t'1')
/t 表示分隔符为制表符
加载数据时出现错误,因为“插入/值不支持 TOK_STRINGLITERALSEQUENCE”。
Expected results
col1 col2 col3 col4 col5
llu ghf a,b,c,d gh,edf,ghu,kjhl 1
解决方案
我不确定您为什么对插入语句使用制表符分隔。这在 Hive 版本 1.2.1 中对我有用
create table test (col1 STRING, col2 STRING, col3 STRING, col4 STRING, col5 STRING);
insert into table test values('llu','ghf','a,b,c,d','gh,edf,ghu,kjhl','1');
select * from test;
+------------+------------+------------+------------------+------------+--+
| test.col1 | test.col2 | test.col3 | test.col4 | test.col5 |
+------------+------------+------------+------------------+------------+--+
| llu | ghf | a,b,c,d | gh,edf,ghu,kjhl | 1 |
+------------+------------+------------+------------------+------------+--+
推荐阅读
- javascript - 仅使用 React useEffect 钩子对某些依赖项运行效果?
- python - 使用元组和整数将字符串转换为混合列表
- c# - 将 SQL 转换为 EF Linq,奇怪/令人困惑的 SQL
- python - Python - 如何通过每次“迭代”更新自身的概率来结束例程?
- java - 不允许 JSON 中的单引号值
- reactjs - 动态禁用输入
- shell - 使用 Ansible 任务计算文件数量并删除除 10 个最新的文件之外的所有文件
- windows - 使用 Windows 终端的 Cygwin 起始目录
- list - 如何将地图数据转换为颤动中的对象列表?
- typescript - 如何获得DefinitelyTyped @types 包版本之间的变化差异?