You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jason Altekruse (JIRA)" <ji...@apache.org> on 2015/01/23 23:56:34 UTC

[jira] [Commented] (DRILL-2060) Support constant folding in expressions in Filter

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

Jason Altekruse commented on DRILL-2060:
----------------------------------------

I have been working on this to specifically allow partition pruning to be used in the case of a constant expression in the filter condition. The initial work I have begun is to remove the RecordBatch from the DrillFunc interfaces, as we will not have a RecordBatch available to pass to the expression evaluation at planning time. This also exposes too much to query state to the UDF writers. We should instead have a more explicit set of query state injectables that are made available. The only one we have to implement right now is a date and timezone wrapper that can be used in UDFs. This was the only use of the interface in the current UDFs.

Here is a message I sent to the list about the change:
http://mail-archives.apache.org/mod_mbox/drill-dev/201501.mbox/browser

Here is a git branch with my current work so far:
https://github.com/jaltekruse/incubator-drill/tree/A2015-01-19-drill-func-refactor-rebased

> Support constant folding in expressions in Filter
> -------------------------------------------------
>
>                 Key: DRILL-2060
>                 URL: https://issues.apache.org/jira/browse/DRILL-2060
>             Project: Apache Drill
>          Issue Type: New Feature
>          Components: Execution - Flow, Query Planning & Optimization
>            Reporter: Aditya Kishore
>            Assignee: Jacques Nadeau
>
> If one side of a filter condition is a constant expression, we should be able to evaluate the expression in the planning phase and replace the expression with the constant value.
> For example, the following filter
> {{Where shipdate < date '1997-01-01' + interval '1' year}}
> can be re-written as
> {{Where shipdate < date '1998-01-01'}}
> Or 
> {{Where age + 5 < 42}}
> can be re-written as
> {{Where age < 37}}



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