Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32B9B18B0E for ; Tue, 13 Oct 2015 00:36:48 +0000 (UTC) Received: (qmail 963 invoked by uid 500); 13 Oct 2015 00:36:41 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 904 invoked by uid 500); 13 Oct 2015 00:36:41 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 891 invoked by uid 99); 13 Oct 2015 00:36:41 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2015 00:36:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 019CFC0BE2 for ; Tue, 13 Oct 2015 00:36:41 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=maprtech.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 5QZpKt59gmkW for ; Tue, 13 Oct 2015 00:36:33 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 4552620D30 for ; Tue, 13 Oct 2015 00:36:32 +0000 (UTC) Received: by igcpe7 with SMTP id pe7so3918128igc.0 for ; Mon, 12 Oct 2015 17:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maprtech.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=6Iymu+hTVfEyQu39xGuOQFMvqgiv6u+P+WZnQ1B+788=; b=Ctfpwu+U+LXbCrajn3C28+G2HLmwkjUq6MxMS/hZPR4juB3dBwoTqnVAvHtfeXwvm0 JEef6XuuRzIHXHg8bybbKTHs9gse0mxjxKvWgHcL+bPjWTNEH1Xt63/N8XRMFAZc11PY S/m54JVf+f0lkJKJWUebAX/DwFnlK+pqHh0sY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6Iymu+hTVfEyQu39xGuOQFMvqgiv6u+P+WZnQ1B+788=; b=cbUKiwH9noHf3y85osxznDzTuazbGlM/ayie8k93ioP251ofNbw8cGdPaMhG//ev7m kc6cK4RApfkpE3+KlW8ZPmMyeE6jBSbF0KjSxD/930+x+hqFAkqM8HeWsrvu+kfSD8Xd QL7yFIQhAgiksjq2pYddV2+uGNXT7a+DJcXn9I2S1VGBIX+E8+5gfPXfk6pwj3Wu76qM 8GL/ncbhkU0uK/VeHMpQY0mb8fCXgu6dD780/EbTDXCSMjbP9TJJ3DnEXJqgnCURsm/9 MOvBy57gyxTrGGv0wzkZAI4CotJnLV7oO28NlfZFxoC/fJYRjTZAeLB3+1WF0638ROv6 UUaA== X-Gm-Message-State: ALoCoQlK+nssXEJgoj38rPH9XTmfZ2/LXovONixOU+0a/fspnj27UBwKgOKlxbAswxorMyFWObHk MIME-Version: 1.0 X-Received: by 10.50.20.8 with SMTP id j8mr15943854ige.69.1444696591256; Mon, 12 Oct 2015 17:36:31 -0700 (PDT) Received: by 10.64.65.229 with HTTP; Mon, 12 Oct 2015 17:36:31 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Oct 2015 17:36:31 -0700 Message-ID: Subject: Re: Improvements to storage plugin planning integration support From: Hanifi Gunes To: dev@drill.apache.org Cc: Julian Hyde , Maryann Xue , James Taylor Content-Type: multipart/alternative; boundary=047d7bd75266216cdc0521f1a314 --047d7bd75266216cdc0521f1a314 Content-Type: text/plain; charset=UTF-8 I would +1 (1-3) for sure. I do not have much understanding of programs however additional flexibility for storage plugin devs sounds cool in general when used responsibly =) so +0 for (4) -H+ On Mon, Oct 12, 2015 at 4:12 PM, Jacques Nadeau wrote: > The dead air must mean that everyone is onboard with my recommendation > > PlannerIntegration StoragePlugin.getPlannerIntegrations() > > interface PlannerIntegration{ > void initialize(Planner, Phase) > } > > Right :D > > -- > Jacques Nadeau > CTO and Co-Founder, Dremio > > On Fri, Oct 9, 2015 at 7:03 AM, Jacques Nadeau wrote: > > > A number of us were meeting last week to work through integrating the > > Phoenix storage plugin. This plugin is interesting because it also uses > > Calcite for planning. In some ways, this should make integration easy. > > However, it also allowed us to see certain constraints who how we expose > > planner integration between storage plugins and Drill internals. > > Currently, Drill asks the plugin to provide a set of optimizer rules > which > > it incorporates into one of the many stages of planning. This is too > > constraining in two ways: > > > > 1. it doesn't allow a plugin to decide which phase of planning to > > integrate with. (This was definitely a problem in the Phoenix case. Our > > hack solution for now is to incorporate storage plugin rules in phases > > instead of just one [1].) > > 2. it doesn't allow arbitrary transformations. Calcite provides a program > > concept. It may be that a plugin needs to do some of its own work using > the > > Hep planner. Currently there isn't an elegant way to do this in the > context > > of the rule. > > 3. There is no easy way to incorporate additional planner initialization > > options. This was almost a problem in the case of the JDBC plugin. It > > turned out that a hidden integration using register() here [2] allowed us > > to continue throughout the planning phases. However, we have to register > > all the rules for all the phases of planning which is a bit unclean. > We're > > hitting the same problem in the case of Phoenix where we need to register > > materialized views as part of planner initialization but the hack from > the > > JDBC case won't really work. > > > > I suggest we update the interface to allow better support for these types > > of integrations. > > > > These seem to be the main requirements: > > 1. Expose concrete planning phases to storage plugins > > 2. Allow a storage plugin to provide additional planner initialization > > behavior > > 3. Allow a storage plugin to provide rules to include a particular > > planning phase (merged with other rules during that phase). > > 4. (possibly) allow a storage plugin to provide transformation programs > > that are to be executed in between the concrete planning phases. > > > > Item (4) above is the most questionable to me as I wonder whether or not > > this could simply be solved by creating a transformation rule (or program > > rule in Calcite's terminology) that creates an alternative tree and thus > be > > solved by (3). > > > > A simple solution might be (if we ignore #4): > > > > PlannerIntegration StoragePlugin.getPlannerIntegrations() > > > > interface PlannerIntegration{ > > void initialize(Planner, Phase) > > } > > > > This way, a storage plugin could register rules (or materialized views) > at > > setup time. > > > > What do others think? > > > > [1] > > > https://github.com/apache/drill/blob/master/contrib/storage-jdbc/src/main/java/org/apache/drill/exec/store/jdbc/JdbcStoragePlugin.java#L145 > > [2] > > > https://github.com/jacques-n/drill/commit/d463f9098ef63b9a2844206950334cb16fc00327#diff-e67ba82ec2fbb8bc15eed30ec6a5379cR119 > > > > -- > > Jacques Nadeau > > CTO and Co-Founder, Dremio > > > --047d7bd75266216cdc0521f1a314--