From issues-return-193810-apmail-hive-issues-archive=hive.apache.org@hive.apache.org Tue Jun 16 16:58:10 2020 Return-Path: X-Original-To: apmail-hive-issues-archive@minotaur.apache.org Delivered-To: apmail-hive-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 73EDF19539 for ; Tue, 16 Jun 2020 16:58:08 +0000 (UTC) Received: (qmail 6479 invoked by uid 500); 16 Jun 2020 16:58:07 -0000 Delivered-To: apmail-hive-issues-archive@hive.apache.org Received: (qmail 6356 invoked by uid 500); 16 Jun 2020 16:58:07 -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 6119 invoked by uid 99); 16 Jun 2020 16:58:06 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2020 16:58:06 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2C4AD41C2E for ; Tue, 16 Jun 2020 16:58:06 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id ED2D27825E1 for ; Tue, 16 Jun 2020 16:58:02 +0000 (UTC) Date: Tue, 16 Jun 2020 16:58:02 +0000 (UTC) From: "ASF GitHub Bot (Jira)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (HIVE-11741) Add a new hook to run before query parse/compile MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-11741?focusedWorklogId=446743&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-446743 ] ASF GitHub Bot logged work on HIVE-11741: ----------------------------------------- Author: ASF GitHub Bot Created on: 16/Jun/20 16:57 Start Date: 16/Jun/20 16:57 Worklog Time Spent: 10m Work Description: github-actions[bot] commented on pull request #63: URL: https://github.com/apache/hive/pull/63#issuecomment-644888564 This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 446743) Remaining Estimate: 0h Time Spent: 10m > Add a new hook to run before query parse/compile > ------------------------------------------------ > > Key: HIVE-11741 > URL: https://issues.apache.org/jira/browse/HIVE-11741 > Project: Hive > Issue Type: New Feature > Components: Parser, SQL > Affects Versions: 1.2.1 > Reporter: Guilherme Braccialli > Assignee: Guilherme Braccialli > Priority: Minor > Labels: patch > Attachments: HIVE-11741.patch > > Time Spent: 10m > Remaining Estimate: 0h > > It would be nice to allow developers to extend hive query language, making possible to use custom wildcards on queries. > People uses Python or R to iterate over vectors or lists and create SQL commands, this could be implemented directly on sql syntax. > For example this python script: > >>> sql = "SELECT state, " > >>> for i in range(10): > ... sql += " sum(case when type = " + str(i) + " then value end) as sum_of_" + str(i) + " ," > ... > >>> sql += " count(1) as total FROM table" > >>> print(sql) > Could be written directly in extended sql like this: > SELECT state, > %for id = 1 to 10% > sum(case when type = %id% then value end) as sum_of_%id%, > %end% > , count(1) as total > FROM table > GROUP BY state > This kind of extensibility can be easily added if we add a new hook after VariableSubstitution call on Driver.compile method. -- This message was sent by Atlassian Jira (v8.3.4#803005)