hadoop - Hive 命令行 - 列名中的反引号问题
问题描述
当我尝试使用 beeline / hive 命令行为以下 DDL 创建表时:
CREATE EXTERNAL TABLE schema.table
(
`Week` string,
`Orders` string,
`Units` string
)
COMMENT 'This table was auto generated'
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
'separatorChar' = ',',
'quoteChar' = '\"',
'escapeChar' = '\\'
)
STORED AS TEXTFILE
LOCATION '/data/qa/ingest_id=1543338670'
TBLPROPERTIES ("skip.header.line.count"="1");
我收到以下错误
Error: Error while compiling statement: FAILED: ParseException line 3:0 character '▒' not supported here
line 3:1 character '▒' not supported here
line 3:2 character '▒' not supported here (state=42000,code=40000)
有没有人遇到过这个问题?此 DDL 在 GUI 客户端上执行没有问题。
解决方案
问题与 UTF 8 编码有关。从 shell 中删除了 unicode 字符。
tr -d '\200-\277' | tr -d '\300-\377'
推荐阅读
- r - 如何在由其他列定义的组内对列中的值进行索引?
- android - 如何在android中执行两个if条件
- flutter - 使用 interactiveScrollViewer 时,有状态的 Builder 不会在颤动中更新列表
- penetration-testing - 带有docker的mascan无法检测到文件
- json - 如何将表中深度嵌套的对象与具有动态数据的 react.js 中的行跨度适当的列进行映射?
- bash - 如何从bash中的字符串中删除非贪婪后缀?
- discord.js - Discord Bot 命令不会做任何我试图修复它但无法弄清楚的事情
- sql - 如何在 Oracle sql Developer 中使用带有特殊字符的用户名访问表
- python - 使用 Python 下载 zip 文件给出 HTTP 403
- swift - 如何在另一个集合视图中创建集合视图