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

Jaideep Dhok commented on LENS-122:
-----------------------------------

Documenting the first condition -

bq. Allowing some fact tables to have expressions directly materialized

For above, we can just check if the fact table already has a concrete column 
(measure or dimension, not an expression) with the same name as the expression 
column. If yes, we will use the concrete column

For example expression is e1 = AVG(msr1) + AVG(msr2), with type double
Fact1 has e1 with type double, hence no need to apply formula, so no need to 
transform AST for e1.
Fact2 does not have e1, but has msr1 and msr2 so we have to apply formula, so 
we have to transform AST for e1
Fact3 does not have e1, and also does not have msr2 so it will be skipped.

At the end, two different ASTs are available each for Fact1 and Fact2. Each of 
them could lead to different joins depending on if the expressions need to be 
realised via a join. How do we choose one of the queries in such a case? 

I think for a single cube query we have to output multiple HQLs, and each HQL 
has to be passed to drivers for cost estimation. Then select the min cost (HQL, 
Driver) pair.




> Add multiple expressions to expression column 
> ----------------------------------------------
>
>                 Key: LENS-122
>                 URL: https://issues.apache.org/jira/browse/LENS-122
>             Project: Apache Lens
>          Issue Type: New Feature
>          Components: cube
>            Reporter: Amareshwari Sriramadasu
>            Assignee: Jaideep Dhok
>             Fix For: 2.0
>
>
> There can be multiple expressions for an expression column and then 
> expression resolver should replace them lazily.
> This was required to solve two usecases:
> # Allowing some fact tables to have expressions directly materialized
> # Having two different expressions in different facts for same expression 
> column



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

Reply via email to