phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-3477) Support sequence arithmetic in Calcite-Phoenix
Date Tue, 06 Dec 2016 20:16:59 GMT

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

ASF GitHub Bot commented on PHOENIX-3477:
-----------------------------------------

Github user lomoree commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/224#discussion_r91162501
  
    --- Diff: phoenix-core/src/it/java/org/apache/phoenix/calcite/CalciteIT.java ---
    @@ -1343,6 +1343,28 @@ public void initTable() throws Exception {
                             {7L, "0000000005", "T5", "0000000005", "S5"},
                             {8L, "0000000006", "T6", "0000000006", "S6"}})
                     .close();
    +
    --- End diff --
    
    While that was my initial thinking, upon looking deeper I discovered a different source
for the issue
    
    The reason a ServerProject was being created was because of visitCall(). It wasn't recursively
checking for sequences. Therefore, when an operator like SqlKind.PLUS was present and the
sequence was present, the sequence would be pushed down to a child operand and not be seen
by visitCall()
    
    PhoenixConverterRules is designed so that a ServerProject does not get created if a sequence
is present
    
     
     ```
    private static Predicate<LogicalProject> NO_SEQUENCE = new Predicate<LogicalProject>()
{
                @Override
                public boolean apply(LogicalProject input) {
                    return !CalciteUtils.hasSequenceValueCall(input);
                }            
            };
    ```


> Support sequence arithmetic in Calcite-Phoenix
> ----------------------------------------------
>
>                 Key: PHOENIX-3477
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3477
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Eric Lomore
>            Assignee: Eric Lomore
>
> When a sequence is wrapped inside an arithmetic operator it is routed through PhoenixServerProject
which does not currently have sequence support
> {{SELECT NEXT VALUE FOR foo.bar+1 FROM SYSTEM.SEQUENCE.}}



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

Mime
View raw message