[
https://issues.apache.org/jira/browse/CALCITE-4424?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17246977#comment-17246977
]
Jiatao Tao commented on CALCITE-4424:
-------------------------------------
Hi [~julianhyde] [~zabetak], this problem comes again and again, and I thinks
there's maybe no best definition, we just define ourselves.
My proposal is that:
The most valuable thing about Calcite, I think its SQL layer, so we should
mainly focus on this part.
If we select the func multiple times and the result is different, we can call
the func is non-deterministic, e.g.:
{code:java}
select func as r1, func as r2{code}
If r1 and r2 are equal, the func is deterministic, if they are not equal, it's
non-deterministic, like "RAND()"
I think this def is simple and executable, most importantly, this eliminates
the ambiguity when optimizing.
> Complete non-deterministic function in SqlFunction
> --------------------------------------------------
>
> Key: CALCITE-4424
> URL: https://issues.apache.org/jira/browse/CALCITE-4424
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Jiatao Tao
> Assignee: Jiatao Tao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Current only SqlSequenceValueOperator override isDeterministic, func like
> RAND doesn't override isDeterministic, these func seems are not
> deterministic(the list comes from "isDynamicFunction"):
> 1. SqlAbstractTimeFunction
> 2. SqlBaseContextVariable
> 3. SqlCurrentDateFunction
> 4. SqlRandFunction
> 5. SqlRandIntegerFunction
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)