Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
Impala 2.7.0
-
None
-
5.7.1-1.cdh5.7.1.p0.11
Description
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:
[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