[ 
https://issues.apache.org/jira/browse/IMPALA-3860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16677475#comment-16677475
 ] 

Tim Armstrong commented on IMPALA-3860:
---------------------------------------

The behaviour appears to have changed here, with the error getting wrapped in 
InternalException and causing a query failure:
{noformat}
[localhost:21000] default> select * from functional.alltypes where month = 
extract(date_sub(cast('2016-07-15T04:45:15Z' as timestamp), interval 6000001 
hour), 'MONTH');
Query: select * from functional.alltypes where month = 
extract(date_sub(cast('2016-07-15T04:45:15Z' as timestamp), interval 6000001 
hour), 'MONTH')
Query submitted at: 2018-11-06 16:58:14 (Coordinator: 
http://tarmstrong-box:25000)
ERROR: InternalException: UDF WARNING: Cannot subtract interval 6000001: Year 
is out of valid range: 1400..9999
{noformat}
I think this was introduced by IMPALA-1788

> Expr evaluation from the FE propagates expr errors with "InternalException"
> ---------------------------------------------------------------------------
>
>                 Key: IMPALA-3860
>                 URL: https://issues.apache.org/jira/browse/IMPALA-3860
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.7.0
>         Environment: 5.7.1-1.cdh5.7.1.p0.11
>            Reporter: kuduser
>            Priority: Minor
>              Labels: supportability, timestamp
>
> I am using this clause to filter a query against a table with partition 
> columns (year,month,day,hour):
> select * from someTable where  
>  cast(concat(cast(year as string), '-', 
>            lpad(cast(month as string), 2, "0"), "-", 
>            lpad(cast(day as string), 2, "0"), " ", 
>            lpad(cast(hour as string), 2, "0"), ":00:00"
>     ) as timestamp) > date_sub(cast('2016-07-15T04:45:15Z' as timestamp), 
> interval 5000001 hour)
> And I get back a non-empty result set.
> However, if I bump up the interval to 6000001, I get back an empty result set.
> This should produce a warning but it does not because the predicate is 
> constant and is evaluated by the FE which cannot propagate the expr warnings.
> Executing the following query does result in the expected warning because the 
> BE executes the fn:
> {code}
> [localhost:21000] > select date_sub(cast('2016-07-15T04:45:15Z' as 
> timestamp), interval 6000001 hour);
> Query: select date_sub(cast('2016-07-15T04:45:15Z' as timestamp), interval 
> 6000001 hour)
> Query submitted at: 2016-08-09 13:01:20 (Coordinator: http://0.0.0.0:25000)
> Query progress can be monitored at: 
> http://0.0.0.0:25000/query_plan?query_id=8e495db99ec360d3:44dec66f8285dbbe
> +----------------------------------------------------------------------------+
> | date_sub(cast('2016-07-15t04:45:15z' as timestamp), interval 6000001 hour) |
> +----------------------------------------------------------------------------+
> | NULL                                                                       |
> +----------------------------------------------------------------------------+
> WARNINGS: UDF WARNING: Cannot subtract interval 6000001: Year is out of valid 
> range: 1400..10000
> Fetched 1 row(s) in 0.01s
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to