在hive SQL中访问以下划线开头的字段

版权声明:https://blog.csdn.net/lvtula https://blog.csdn.net/lvtula/article/details/89552536

在hive SQL中访问以下划线开头的字段,例如_column_name时,会报如下错误

NoViableAltException(13@[323:1: atomExpression : ( ( KW_NULL )=> KW_NULL -> TOK_NULL | ( constant )=> constant | castExpression | caseExpression | whenExpression | ( functionName LPAREN )=> function | tableOrColumn | LPAREN ! expression RPAREN !);])
FAILED: ParseException line 5:11 cannot recognize input near '_xxx' ',' ''xxx'' in expression specification

从错误提示信息来看,是对SQL进行语法解析时失败了。改正的方法为

在使用以下划线开头的字段时,给该字段加上字段引号``即可。字段引号是键盘靠近左上角位置,标记有~和`的那个键。

Mac 打出反引号 (`)

输入法,在英文状态下,

option + 1 左侧的健

ok

猜你喜欢

转载自blog.csdn.net/lvtula/article/details/89552536
今日推荐