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 4EA02200BF3 for ; Thu, 5 Jan 2017 11:13:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4D418160B26; Thu, 5 Jan 2017 10:13:00 +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 689D3160B45 for ; Thu, 5 Jan 2017 11:12:59 +0100 (CET) Received: (qmail 93547 invoked by uid 500); 5 Jan 2017 10:12:58 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 93438 invoked by uid 99); 5 Jan 2017 10:12:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2017 10:12:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 69F3E2C2A66 for ; Thu, 5 Jan 2017 10:12:58 +0000 (UTC) Date: Thu, 5 Jan 2017 10:12:58 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-15539) Optimize complex multi-insert queries in Calcite MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Jan 2017 10:13:00 -0000 [ https://issues.apache.org/jira/browse/HIVE-15539?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesus Camacho Rodriguez updated HIVE-15539: ------------------------------------------- Attachment: HIVE-15539.03.patch > Optimize complex multi-insert queries in Calcite > ------------------------------------------------ > > Key: HIVE-15539 > URL: https://issues.apache.org/jira/browse/HIVE-15539 > Project: Hive > Issue Type: Improvement > Components: Parser > Affects Versions: 2.2.0 > Reporter: Jesus Camacho Rodriguez > Assignee: Jesus Camacho Rodriguez > Attachments: HIVE-15539.03.patch > > > Currently multi-insert queries are not optimized by Calcite. Proper integration with Calcite would include creating a _spool_ operator whose output is reused by every _insert_ statement; however, _spool_ operator has not been added to Calcite yet (CALCITE-481). > In the meantime, and since complex logic for multi-insert queries is in FROM clause, we can optimize the FROM clause with Calcite and connect the optimized result to the original query. > Initially, we will recognize three different cases: > - FROM clause is trivial, e.g., table reference, or not supported. No need to optimize with Calcite. > - FROM clause is a subquery. Optimize the subquery with Calcite. > - FROM clause is a join. Rewrite join into a subquery and optimize it with Calcite. Change references in INSERT statements to refer to subquery columns. > This should be beneficial for MERGE statements processing too, since MERGE statements are treated as multi-insert queries by Hive. -- This message was sent by Atlassian JIRA (v6.3.4#6332)