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

ASF GitHub Bot commented on STORM-1434:
---------------------------------------

GitHub user HeartSaVioR opened a pull request:

    https://github.com/apache/storm/pull/1633

    STORM-1434 Support the GROUP BY clause in StormSQL

    * Support GROUP BY for Trident
    * Implement basic functions for aggregation
    * Change the way of converting Calcite logical plan to Trident logical plan
    ** before: creating codes and compile them
    ** after: use Trident features, only creating code block if evaluation is 
needed
    *** Janino comes in to help evaluating code block in runtime
    
    This change can handle the below sql statements in runtime:
    
    ```
    CREATE EXTERNAL TABLE ORDERS (ID INT PRIMARY KEY, UNIT_PRICE INT, QUANTITY 
INT) LOCATION 'kafka://localhost:2181/brokers?topic=orders' TBLPROPERTIES 
'{"producer":{"bootstrap.servers":"localhost:9092","acks":"1","key.serializer":"org.apache.storm.kafka.IntSerializer","value.serializer":"org.apache.storm.kafka.ByteBufferSerializer"}}'
    CREATE EXTERNAL TABLE LARGE_ORDERS (ID INT PRIMARY KEY, TOTAL INT) LOCATION 
'kafka://localhost:2181/brokers?topic=large_orders' TBLPROPERTIES 
'{"producer":{"bootstrap.servers":"localhost:9092","acks":"1","key.serializer":"org.apache.storm.kafka.IntSerializer","value.serializer":"org.apache.storm.kafka.ByteBufferSerializer"}}'
    INSERT INTO LARGE_ORDERS SELECT ID, UNIT_PRICE * QUANTITY AS TOTAL FROM 
ORDERS WHERE UNIT_PRICE * QUANTITY > 50
    ```
    
    ```
    CREATE EXTERNAL TABLE ORDERS (ID INT PRIMARY KEY, UNIT_PRICE INT, QUANTITY 
INT) LOCATION 'kafka://localhost:2181/brokers?topic=orders' TBLPROPERTIES 
'{"producer":{"bootstrap.servers":"localhost:9092","acks":"1","key.serializer":"org.apache.storm.kafka.IntSerializer","value.serializer":"org.apache.storm.kafka.ByteBufferSerializer"}}'
    CREATE EXTERNAL TABLE SUMMARY_ORDERS (ID INT PRIMARY KEY, UNIT_PRICE_AVG 
DOUBLE, SUM_OF_QUANTITY INT) LOCATION 
'kafka://localhost:2181/brokers?topic=large_orders' TBLPROPERTIES 
'{"producer":{"bootstrap.servers":"localhost:9092","acks":"1","key.serializer":"org.apache.storm.kafka.IntSerializer","value.serializer":"org.apache.storm.kafka.ByteBufferSerializer"}}'
    INSERT INTO SUMMARY_ORDERS SELECT ID, AVG(UNIT_PRICE) AS UNIT_PRICE_AVG, 
SUM(QUANTITY) AS SUM_OF_QUANTITY FROM ORDERS GROUP BY ID
    ```
    
    This can be easily backported to 1.x branch since it only touches storm-sql 
module.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HeartSaVioR/storm STORM-1454

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/1633.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1633
    
----
commit fc93fdad03c25967e7b00cc9c2289f46d71fb0a9
Author: Jungtaek Lim <[email protected]>
Date:   2016-08-18T07:32:46Z

    STORM-1434 Support the GROUP BY clause in StormSQL
    
    * Support GROUP BY for Trident
    * Implement basic functions for aggregation
    * Change the way of converting Calcite logical plan to Trident logical plan
    ** before: creating codes and compile them
    ** after: use Trident features, only creating code block if evaluation is 
needed
    *** Janino comes in to help evaluating code block in runtime

----


> Support the GROUP BY clause in StormSQL
> ---------------------------------------
>
>                 Key: STORM-1434
>                 URL: https://issues.apache.org/jira/browse/STORM-1434
>             Project: Apache Storm
>          Issue Type: New Feature
>          Components: storm-sql
>            Reporter: Haohui Mai
>
> This jira tracks the effort of implement the support `GROUP BY` clause in 
> StormSQL.



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

Reply via email to