[ 
https://issues.apache.org/jira/browse/HIVE-12884?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gabor Szadovszky updated HIVE-12884:
------------------------------------
    Attachment: HIVE-12884.q

Actually, there are two mistakes in the query. One is mentioned above, the 
other one is an extra ',' at the end of line "floor((`timestamp` ...".
Was not able to reproduce the NPE with any combinations of the mentioned 
mistakes on the latest Hive 2.2.0. In any combinations ParseExceptions were 
thrown.
See the attached query file created to reproduce the issue. 
(After correcting the mentioned mistakes the query runs smoothly.)

> NullPointerException in HiveParser.regularBody()
> ------------------------------------------------
>
>                 Key: HIVE-12884
>                 URL: https://issues.apache.org/jira/browse/HIVE-12884
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 1.1.1
>            Reporter: Bohumir Zamecnik
>            Assignee: Gabor Szadovszky
>         Attachments: HIVE-12884.q
>
>
> When I make a query like the following in Hive CLI I get a 
> NullPointerException in HiveParser.regularBody().
> {code}
> create table some_table
> (
>     day_timestamp bigint,
>     guid_count bigint
> )
> row format delimited fields terminated by ',' stored as textfile;
> SET hive.merge.mapredfiles=true;
> SET mapreduce.input.fileinputformat.split.maxsize=5368709120;
> SET hivevar:tz_offset=8;
> SET hivevar:day_in_millis=86400000;
> SET hivevar:year=2015;
> SET hivevar:month=02;
> SET hivevar:next_month=03;
> insert into table some_table
> select
>   day_timestamp
>   count(*) as guid_count
> from (
>   select distinct
>     guid,
>     floor((`timestamp` / ${day_in_millis}) - ${tz_offset}) * ${day_in_millis} 
> as day_timestamp,
>   from source_table
>   where year = ${year} and ((month = ${month}) or ((month = ${next_month}) 
> and (day = '01')))
> ) guids
> group by day_timestamp;
> {code}
> /tmp/username/hive.log:
> {code}
> 2016-01-18 10:05:40,505 ERROR [main]: ql.Driver 
> (SessionState.java:printError(861)) - FAILED: NullPointerException null
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:40975)
>         at 
> org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:40183)
>         at 
> org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:40059)
>         at 
> org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1519)
>         at 
> org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1057)
>         at 
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
>         at 
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:393)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:307)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1112)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1160)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1039)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:754)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> {code}
> Hive 1.1.1 compiled from source with checksum 
> c2d70ca009729fb13c073d599b4e5193.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to