Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E280D200B8B for ; Tue, 20 Sep 2016 07:56:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E101F160ADC; Tue, 20 Sep 2016 05:56:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09E57160ACC for ; Tue, 20 Sep 2016 07:56:26 +0200 (CEST) Received: (qmail 98389 invoked by uid 500); 20 Sep 2016 05:56:26 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 98378 invoked by uid 99); 20 Sep 2016 05:56:26 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 05:56:26 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AB9E71A003A for ; Tue, 20 Sep 2016 05:56:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id mUWQqzaGQP_u for ; Tue, 20 Sep 2016 05:56:23 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 299F960D1F for ; Tue, 20 Sep 2016 05:56:21 +0000 (UTC) Received: (qmail 97345 invoked by uid 99); 20 Sep 2016 05:56:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 05:56:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 065602C1B7D for ; Tue, 20 Sep 2016 05:56:21 +0000 (UTC) Date: Tue, 20 Sep 2016 05:56:21 +0000 (UTC) From: "Chinmay Kolhatkar (JIRA)" To: dev@apex.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (APEXMALHAR-1818) Integrate Calcite to support SQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 20 Sep 2016 05:56:28 -0000 [ https://issues.apache.org/jira/browse/APEXMALHAR-1818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15505682#comment-15505682 ] Chinmay Kolhatkar edited comment on APEXMALHAR-1818 at 9/20/16 5:56 AM: ------------------------------------------------------------------------ Here is a quick update on Apex-Calcite integration work. Currently I'm able to run SQL statement as a DAG against registered table abstractions of data endpoint and message type. Here is the SQL support that is currently implemented: # Data Endpoint (Source/Destination): #* File #* Kafka # Message Types from Data endpoint (source/destination): #* CSV # SQL Functionality Support: #* SELECT (Projection) - Select from Source #* INSERT - Insert into Destination #* WHERE (Filter) #* Scalar functions which are provided in Calcite core #* Custom sclar function can be defined as provided to SQL. # Table can be defined as abstraction of Data Endpoint (source/dest) and message type Currently Calcite integration with Apex is exposed as a small boiler plate code in populateDAG as follows: {code} SQLExecEnvironment.getEnvironment(dag) .registerTable("ORDERS", new KafkaEndpoint(broker, sourceTopic, new CSVMessageFormat(schemaIn))) .registerTable("SALES", new KafkaEndpoint(broker, destTopic, new CSVMessageFormat(schemaOut))) .registerFunction("APEXCONCAT", FileEndpointTest.class, "apex_concat_str") .executeSQL("INSERT INTO SALES " + "SELECT STREAM ROWTIME, " + "FLOOR(ROWTIME TO DAY), " + "APEXCONCAT('OILPAINT', SUBSTRING(PRODUCT, 6, 7)) " + "FROM ORDERS WHERE ID > 3 " + "AND " + "PRODUCT LIKE 'paint%'"); {code} Following is a video recording of the demo of apex-capcite integration: https://drive.google.com/open?id=0B_Tb-ZDtsUHeUVM5NWRYSFg0Z3c Currently I'm working on addition of inner join functionality. Once the inner join functionality is implemented, I think the code is good to create a Review Only PR for first cut of calcite integration. The code is here: https://github.com/chinmaykolhatkar/apex-malhar/tree/calcite/sql [~julianhyde] [~thw] [~ilganeli] [~akekre] Please share your opinion on above. Thanks, Chinmay. was (Author: chinmay): Here is a quick update on Apex-Calcite integration work. Currently I'm able to run SQL statement as a DAG against registered table abstractions of data endpoint and message type. Here is the SQL support that is currently implemented: 1. Data Endpoint (Source/Destination): - File - Kafka 2. Message Types from Data endpoint (source/destination): - CSV 3. SQL Functionality Support: - SELECT (Projection) - Select from Source - INSERT - Insert into Destination - WHERE (Filter) - Scalar functions which are provided in Calcite core - Custom sclar function can be defined as provided to SQL. 4. Table can be defined as abstraction of Data Endpoint (source/dest) and message type Currently Calcite integration with Apex is exposed as a small boiler plate code in populateDAG as follows: {code} SQLExecEnvironment.getEnvironment(dag) .registerTable("ORDERS", new KafkaEndpoint(broker, sourceTopic, new CSVMessageFormat(schemaIn))) .registerTable("SALES", new KafkaEndpoint(broker, destTopic, new CSVMessageFormat(schemaOut))) .registerFunction("APEXCONCAT", FileEndpointTest.class, "apex_concat_str") .executeSQL("INSERT INTO SALES " + "SELECT STREAM ROWTIME, " + "FLOOR(ROWTIME TO DAY), " + "APEXCONCAT('OILPAINT', SUBSTRING(PRODUCT, 6, 7)) " + "FROM ORDERS WHERE ID > 3 " + "AND " + "PRODUCT LIKE 'paint%'"); {code} Following is a video recording of the demo of apex-capcite integration: https://drive.google.com/open?id=0B_Tb-ZDtsUHeUVM5NWRYSFg0Z3c Currently I'm working on addition of inner join functionality. Once the inner join functionality is implemented, I think the code is good to create a Review Only PR for first cut of calcite integration. The code is here: https://github.com/chinmaykolhatkar/apex-malhar/tree/calcite/sql [~julianhyde] [~thw] [~ilganeli] [~akekre] Please share your opinion on above. Thanks, Chinmay. > Integrate Calcite to support SQL > -------------------------------- > > Key: APEXMALHAR-1818 > URL: https://issues.apache.org/jira/browse/APEXMALHAR-1818 > Project: Apache Apex Malhar > Issue Type: New Feature > Components: query operators > Reporter: Amol > Assignee: Chinmay Kolhatkar > Labels: roadmap > > Once we have ability to generate a subdag, we should take a look at integrating Calcite into Apex. The operator that enables populate DAG, should use Calcite to generate the DAG, given a SQL query. -- This message was sent by Atlassian JIRA (v6.3.4#6332)