2017-12-27 23 views
0

아래와 같이 "IN"절에서 여러 열로 하이브 지원 쿼리를 수행합니까?하이브로 "IN"절에 복수 열

select * from address where (se10,ctry_nm) IN (44444444,"USA"); 

내가이 쿼리에 오류가 아래에 무엇입니까 -

at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617) 
    at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.atomExpression(HiveParser_IdentifiersParser.java:6318) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceFieldExpression(HiveParser_IdentifiersParser.java:6383) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnaryPrefixExpression(HiveParser_IdentifiersParser.java:6768) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceUnarySuffixExpression(HiveParser_IdentifiersParser.java:6828) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseXorExpression(HiveParser_IdentifiersParser.java:7012) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceStarExpression(HiveParser_IdentifiersParser.java:7172) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedencePlusExpression(HiveParser_IdentifiersParser.java:7332) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAmpersandExpression(HiveParser_IdentifiersParser.java:7483) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceBitwiseOrExpression(HiveParser_IdentifiersParser.java:7634) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceEqualExpression(HiveParser_IdentifiersParser.java:8164) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceNotExpression(HiveParser_IdentifiersParser.java:9177) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceAndExpression(HiveParser_IdentifiersParser.java:9296) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.precedenceOrExpression(HiveParser_IdentifiersParser.java:9455) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.expression(HiveParser_IdentifiersParser.java:6105) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.expression(HiveParser.java:45856) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.searchCondition(HiveParser_FromClauseParser.java:6637) 
    at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.whereClause(HiveParser_FromClauseParser.java:6545) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.whereClause(HiveParser.java:45911) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.selectStatement(HiveParser.java:41543) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:41402) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:40413) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:40283) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1590) 
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1109) 
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202) 
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166) 
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:397) 
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:309) 
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1146) 
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1194) 
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1083) 
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1073) 
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213) 
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165) 
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376) 
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:745) 
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:690) 
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:626) 
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221) 
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136) 

실패 : 표현 사양

답변

2

호에) 근처에 'SE10을'기대 ','ParseException을 선 1시 33분 일치하지 않는 입력 두 개의 열을 두 개의 값과 비교하는 경우 간단한 =이면 충분합니다. AND 또는 OR입니다.

select * from address where se10 = 44444444 and ctry_nm = "USA"; 

또는 하이브 0.13에서

select * from address where se10 in (44444444) and ctry_nm in ("USA"); 
0

내가 할 것

SELECT * 
    FROM address 
WHERE CONCAT(se10,ctry_nm) IN ('44444444USA');