[ 
https://issues.apache.org/jira/browse/HIVE-24839?focusedWorklogId=559944&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-559944
 ]

ASF GitHub Bot logged work on HIVE-24839:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Mar/21 13:08
            Start Date: 02/Mar/21 13:08
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on a change in pull request #2034:
URL: https://github.com/apache/hive/pull/2034#discussion_r585549664



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
##########
@@ -174,8 +174,10 @@ public StatEstimator getStatEstimator() {
     }
 
     private Optional<Double> getRangeWidth(Range range) {
-      if (range.minValue != null && range.maxValue != null) {
-        return Optional.of(range.maxValue.doubleValue() - 
range.minValue.doubleValue());
+      if (range != null) {

Review comment:
       could you please also add the testcase from the jira?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 559944)
    Time Spent: 20m  (was: 10m)

> SubStrStatEstimator.estimate throws NullPointerException
> --------------------------------------------------------
>
>                 Key: HIVE-24839
>                 URL: https://issues.apache.org/jira/browse/HIVE-24839
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Robbie Zhang
>            Assignee: Robbie Zhang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> This issue can be reproduced by running the following queries:
> {code:java}
> create table t0 (s string);
> create table t1 (s string, i int);
> insert into t0 select "abc";
> insert into t1 select "abc", 4;
> select substr(t0.s, t1.i-1) from t0 join t1 on t0.s=t1.s;
> {code}
> The select query fails with error:
> {code:java}
> Error: Error while compiling statement: FAILED: NullPointerException null 
> (state=42000,code=40000)
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to