Return-Path: X-Original-To: apmail-asterixdb-dev-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C06AC180D0 for ; Sun, 14 Feb 2016 22:48:56 +0000 (UTC) Received: (qmail 92303 invoked by uid 500); 14 Feb 2016 22:48:56 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 92247 invoked by uid 500); 14 Feb 2016 22:48:56 -0000 Mailing-List: contact dev-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list dev@asterixdb.incubator.apache.org Received: (qmail 92234 invoked by uid 99); 14 Feb 2016 22:48:56 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Feb 2016 22:48:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id ECBDA18027D for ; Sun, 14 Feb 2016 22:48:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 4eTn4uF3xgCH for ; Sun, 14 Feb 2016 22:48:53 +0000 (UTC) Received: from mail-yw0-f177.google.com (mail-yw0-f177.google.com [209.85.161.177]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 0F3FD5FAD8 for ; Sun, 14 Feb 2016 22:48:53 +0000 (UTC) Received: by mail-yw0-f177.google.com with SMTP id h129so102911071ywb.1 for ; Sun, 14 Feb 2016 14:48:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vN7fAa3cqbJboQb176Dk9skccCSAgJtBIXsDrVIt6dU=; b=h/B4G9szQ1zTbG/Ed330doF+2n3CAO6KoWAjDl+vVslB6PDVDHm5Dmh/9o4gyzAOb+ aiEC5skxI+/N+Hl3tdLokcdopGir3ZuJHj4+fOSouF/1aUbGMA6eJ7hGoB9UXq9KYoWg jTF9AtflSW4K+i89r6IzElhQdHrcynrUDRFHYxs4bXQNS7GYROHavY4PVvnDUKACsDyL 10RV5r9ADm5ndi5ltGrQb/JdLEgZTCjqPdDzN6Yb0cU6Fed/Dn/E5YEF4s7lO4p0q6/k TC54T7ICIMdyMSmsvdZLHaz6OuGd3taBVZkZKdSRmNbKHWsO4z62c4hqHhdnPpDBm2R8 L7gA== 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:content-type; bh=vN7fAa3cqbJboQb176Dk9skccCSAgJtBIXsDrVIt6dU=; b=gxcPx1naDl+nQ/o28syyXItPjtV6xeVJOv7l6NArlPnTC04HisCua51eS7mv7Kjg2D 46SQQhEFynwaLQYh56yH9TigDKS8OH0hQGQuwtC/gcRxszewGflys5eWb0d9yUe/7LKz WnYzACbnLPnDYYYRUijMurDVBS3dXZM3bvMKxgylDL3DMNr1EPsfzkZt5lj6VdFaTDpl MFeh1Pm+E3IszUv4P6CO5gwAvQA8THD8xIEJ9UEqx4K1bCeuL3oFA7P2SCYt5qJJ3Ib0 GIqh/3XCAbkGbEIgKGnu49E+G3yH2CyqXCQFlSedoNxc/Tb4VDBsSRxjenM/R41mrFdb DiyA== X-Gm-Message-State: AG10YOTVEaR4uH/RcgDhKmthYqymiZSnpYdTD7UfhnO5cft6X6mpn5qb0tbGMi4L+4PE2SYCzAdB3SnLZRXIGQ== MIME-Version: 1.0 X-Received: by 10.129.76.17 with SMTP id z17mr7339535ywa.191.1455490132458; Sun, 14 Feb 2016 14:48:52 -0800 (PST) Received: by 10.37.100.138 with HTTP; Sun, 14 Feb 2016 14:48:52 -0800 (PST) In-Reply-To: <56C0FF16.8050607@gmail.com> References: <839EDBDF-682A-4676-8F69-E0BE0D702D57@apache.org> <56C0FF16.8050607@gmail.com> Date: Sun, 14 Feb 2016 14:48:52 -0800 Message-ID: Subject: Re: Question on language translation for Algebricks From: Yingyi Bu To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=001a113f2bdc51c5d3052bc2b442 --001a113f2bdc51c5d3052bc2b442 Content-Type: text/plain; charset=UTF-8 Hi Sandeep, Here is the Hivesterix codebase in the Apache source tree: https://github.com/apache/incubator-asterixdb-hyracks/tree/fullstack-0.2.13 We have maintained Hivesterix up to hyracks-0.2.13, but stopped maintaining after that release. Mike has elaborated the reason. >> Furthermore, none of these rewrite rules seem to be SQL-specific. Are there any SQL-specific rewrite rules which were added? That's exactly the motivation of the Algebricks project --- most rules that a typical SQL compiler implemented are not SQL-specific:-) However, there indeed are few Hive-specific rules that I added in order to get the Hive-on-Algebricks plan work efficiently: https://github.com/apache/incubator-asterixdb-hyracks/tree/fullstack-0.2.13/hivesterix/hivesterix-optimizer/src/main/java/edu/uci/ics/hivesterix/optimizer/rules The Hivesterix implementation first translates a Hive-optimized MR plan into an Algebricks logical plan, and then let Algebricks do further optimizations and finally execute the resulting Hyracks job on the Hyracks runtime. Best, Yingyi On Sun, Feb 14, 2016 at 2:26 PM, Mike Carey wrote: > Sandeep, > > Just to chime in as well: > > - VXQuery is indeed the best example to look at, probably, to understand > the AsterixDB/Algebricks separation. > > - Hivesterix was built by Yingyi Bu (who'll see this) early on - it drove > the separation idea, actually, but we made a decision not to try and > maintain it. It was intended to provide a third/different proof of > separation and applicability of the approach, from a research standpoint, > but doesn't have additional value to offer the world (since Hive itself is > a moving target and Hive on Tez now provides the non-MapReduce-runtime > value that Hivesterix initially offered). Yingi would probably be happy to > share the code base with you if you wanted to look at it for any reason, > but the only things in the Apache AsterixDB (incubating) project are things > deemed worthy of engineering/maintenance work. > > Hope that helps too! > > Cheers, > Mike > > > > On 2/14/16 11:47 AM, Till Westmann wrote: > >> Hi Sandeep, >> >> Apache VXQuery, the XQuery implementation mentioned in the SoCC paper, is >> a separate project [1]. >> >> Specifically to your questions: >> >> 1) There is no need to implement other projects that use Algebricks >> inside of the AsterixDB source tree (as VXQuery shows). >> >> 2) It is clearly easier to combine a Java parser and plan tree generator >> with Algebricks, but there's no reason why one couldn't connect to other >> languages (e.g. by using a text-based intermediate format between the >> parser and the optimizer and between the plan generator and the runtime). >> >> 3) The reason for the different set of rules is that some are language >> agnostic and some are language-specific. As you can see in figure 2 of the >> paper a language implementation has to provide language-specific rules to >> augment the language-agnostic rules provided by Algebricks. >> Specifically, the rules in AsterixDB's asterix-algebra project augment >> the rules in Algebricks to support AsterixDB's query language AQL. >> >> Hope this helps, >> Till >> >> [1] http://vxquery.apache.org >> >> On 14 Feb 2016, at 11:02, Sandeep Joshi wrote: >> >> I had some questions about the process of mapping other query languages to >>> Algebricks. The Sigmod SoCC 15 paper mentions that two languages XQuery >>> and HiveQL which have been mapped to Algebricks, but the implementation >>> is >>> not found in either of the two repositories released under Apache. >>> >>> I found Hivesterix and Pregelix under >>> https://github.com/madhusudancs/hyracks/tree/master/fullstack/hivesterix >>> >>> I couldn't find the XQuery to Algebricks translator anywhere. Has this >>> been released ? >>> >>> What is the reason these language translators are not part of the Apache >>> repository ? >>> >>> The Apache repositories contain the language translators for AQL and SQL. >>> After comparing the implementations for Hivesterix and SQL/AQL, here are >>> some questions >>> >>> 1) Does one have to integrate the parser for a new language within the >>> Apache AsterixDB source tree, or can one build the Algebricks translator >>> outside the Apache tree and invoke the Hyracks job execution engine >>> directly, as is being done in the hivesterix implementation seen here. >>> >>> >>> https://github.com/madhusudancs/hyracks/blob/36bb1021b17b736aa1648bd439e1246ae419aa89/fullstack/hivesterix/hivesterix-dist/src/main/java/edu/uci/ics/hivesterix/runtime/exec/HyracksExecutionEngine.java >>> >>> 2) When a query language is converted to Algebricks, the ICompilerFactory >>> converts one plan tree to another by calling Visitor::visit() on each >>> node >>> of the source query. Does this imply that the plan tree for the source >>> language can only be constructed in Java ? Would it be >>> difficult/impossible to integrate a parser and plan tree generator which >>> was written in any language into Algebricks ? >>> >>> 3) In the Apache repositories, the query rewrite rules which are used >>> during optimization are found under two different repositories. >>> >>> One in main asterixdb repository >>> >>> >>> https://github.com/apache/incubator-asterixdb/tree/master/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules >>> >>> and the other in the hyracks repository >>> >>> >>> https://github.com/apache/incubator-asterixdb-hyracks/tree/master/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules >>> >>> Are these two sets of rules characteristically different or is this >>> duplication just an artifact of rapid prototyping ? >>> >>> Furthermore, none of these rewrite rules seem to be SQL-specific. Are >>> there any SQL-specific rewrite rules which were added ? >>> >>> -Sandeep >>> >> > --001a113f2bdc51c5d3052bc2b442--