You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2014/10/01 07:52:35 UTC
[jira] [Updated] (PHOENIX-1030) Change Expression.isDeterministic()
to return an ENUM with three values {DETERMINISTIC, UNDETERMINISTIC_ROW,
UNDETERMINISTIC_STMT}
[ https://issues.apache.org/jira/browse/PHOENIX-1030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas D'Silva updated PHOENIX-1030:
------------------------------------
Attachment: PHOENIX-1030-3.0.patch
PHOENIX-1030-4.0.patch
[~jamestaylor]
Thanks for the feedback. I have attached a patch for 3.2 and 4.2/master with the changes.
I used Determism.combine in ExpressionCompiler.java where &= was being called.
I also added a unit test DeterminismTest that tests the combine method.
For the code in ComparisonExpression that or-ed two determinism, I think you are right it should have been &&, I have changed it as follows:
{code}
- boolean isDeterministic = lhsExpr.isDeterministic() || rhsExpr.isDeterministic();
+ Determinism determinism = lhsExpr.getDeterminism().combine(rhsExpr.getDeterminism());
{code}
I also removed the Determinism.NEVER and used DETERMINISM.PER_ROW where false was being used.
Thanks,
Thomas
> Change Expression.isDeterministic() to return an ENUM with three values {DETERMINISTIC, UNDETERMINISTIC_ROW, UNDETERMINISTIC_STMT}
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Key: PHOENIX-1030
> URL: https://issues.apache.org/jira/browse/PHOENIX-1030
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Thomas D'Silva
> Assignee: Thomas D'Silva
> Attachments: PHOENIX-1030-3.0.patch, PHOENIX-1030-3.0.patch, PHOENIX-1030-3.0.patch, PHOENIX-1030-4.0.patch, PHOENIX-1030-4.0.patch, PHOENIX-1030-master.patch
>
>
> Change Expression.isDeterministic() to return an ENUM with three values
> DETERMINISTIC - the expression returns the same output every time given the same input.
> UNDETERMINISTIC_ROW - the expression should be computed for every row
> UNDETERMINISTIC_STMT - the expression should be be computed for a given statement only once
> See PHOENIX-1001
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)