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 DD969200D0F for ; Thu, 14 Sep 2017 19:14:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DBFAE1609CD; Thu, 14 Sep 2017 17:14: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 03A991609C6 for ; Thu, 14 Sep 2017 19:14:26 +0200 (CEST) Received: (qmail 91533 invoked by uid 500); 14 Sep 2017 17:14:26 -0000 Mailing-List: contact dev-help@orc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@orc.apache.org Delivered-To: mailing list dev@orc.apache.org Received: (qmail 91517 invoked by uid 99); 14 Sep 2017 17:14:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2017 17:14:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 5F39EC2528 for ; Thu, 14 Sep 2017 17:14:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.679 X-Spam-Level: * X-Spam-Status: No, score=1.679 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id YSpQVN9TXsOQ for ; Thu, 14 Sep 2017 17:14:24 +0000 (UTC) Received: from mail-qt0-f178.google.com (mail-qt0-f178.google.com [209.85.216.178]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9E9515FBC6 for ; Thu, 14 Sep 2017 17:14:23 +0000 (UTC) Received: by mail-qt0-f178.google.com with SMTP id o52so868908qtc.9 for ; Thu, 14 Sep 2017 10:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=u6+zH1+faOaKyQvk+ZUXb6VZbmGXzSygdKTIts67AoU=; b=XuKwqOsmqwwA+c2dkpozuTI6WB4ruO04TYP7aqCVWO3rVyWqL2m1vtC7iO3baypzX9 vVOKC/p34P39Sm15IWZz12yGisPVHWqmDNrt/DaEjIMjOWrFa/4H5UiGu2VO5MpoMrG0 Njuv99q5plHeLIYO5XqsbX137VA2tt+w+HpLn48toAzp73K6ewXoH7RFaSs7R07K3MCv tRSko0bOHwkIo0xOcxX6cb4Qt340/Vfq1fjJiSPVC1CwK8wqMwI/K9Ln9w/OU3I+G/2b ahWq7wHtLxG2qJZ61pPyamkiyyswzVjkuk1KA/AsCPw2K29cQ/5TNTjF3WVkpSV+SuXy 2TmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=u6+zH1+faOaKyQvk+ZUXb6VZbmGXzSygdKTIts67AoU=; b=Wezqa8rg3bAotfiV1EyHCTFj69B/iEqvGdfoh6mGe5agYd2rmqUiM4+RHcoY+Jp3dD zwJgVp6jSbaVJnj8jMyvLiNS+uXAALBOthP4CLX/d8Bc0ESZyzdqfnwWDDDeQ4gcW+gR jrJsn0PXtK1vSPqDJqpeORUDV/cNSe+YnSSSboTtozKN7127754Cn0b0Tn9y0q3HBl9G x9h9qW11wX3SylppM+hbIx0szQHi6qpYt0PSWBbMNw3EU9f781VHJqr6J3YkfeatwWtE c6Zt24rhSpAVFcMQKFTjm4WrJa0BDrNbgL0mx7sicFJtL6gizfhfEVNOochKw4oL15AD ZQOg== X-Gm-Message-State: AHPjjUgGB3ut8U8UCTdhqOVi4AQh6pYL5Lu68dI3q97YyXEMHvXwUFkT k5pgc04zXcDmY4WI8Y2/MRQfADWNLyLoeBTPGWi1zg== X-Google-Smtp-Source: AOwi7QAqPivWkc2dpqtwEvpb5a3hcCpSmyZKYdF61RoArfb1DK/B3cQ2bI44JkgkzUvgPpPVCh0n3WttjRrk7vILKyY= X-Received: by 10.200.22.231 with SMTP id y36mr33428484qtk.31.1505409262506; Thu, 14 Sep 2017 10:14:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.50.175 with HTTP; Thu, 14 Sep 2017 10:14:22 -0700 (PDT) In-Reply-To: References: From: Alan Gates Date: Thu, 14 Sep 2017 10:14:22 -0700 Message-ID: Subject: Re: Thoughts on Acid reader To: dev@orc.apache.org Content-Type: multipart/alternative; boundary="94eb2c03ca7a55576f05592968a4" archived-at: Thu, 14 Sep 2017 17:14:28 -0000 --94eb2c03ca7a55576f05592968a4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =E2=80=8BFor performance reasons, you prefer the second option that I rejec= ted where users give a file and the system finds the deletes from there. I can buy that. As for passing splits rather than files, that makes sense but seems like a bigger change, since this should work with and without ACID, so I=E2=80=99l= l leave that for a later time. I don=E2=80=99t follow your last comment about ROW__ID being projected out = to the user. ORC isn=E2=80=99t currently hiding that field from the reader is it? Alan.=E2=80=8B On Wed, Sep 13, 2017 at 8:47 PM, Gopal Vijayaraghavan wrote: > > The first thing that strikes me is that createReader takes a file. > > But for acid, you need to pass the directory because it needs to look > for any relevant delta files. > > The ACID 2.x impl, the InputFormat gets a directory - but a Reader should > still be getting an individual file. > > In fact, it should be getting something smaller than a File (ideally an > HDFS block) which is encoded as FileSplit (path, offset, len) and a > ValidTxnList. > > In the original ACID impl, multiple delta files get a single Reader, whil= e > in the new ACID 2.x impl the concept of a "base file + deltas" is > irrelevant. > > All insert deltas are equivalent base files - the base concept is (1 > Stripe) + (Relevant deletes) =3D=3D 1 vector reader. > > There's no need to know which delete deltas were already read unlike the > UPDATE ops (i.e Split #1 and Split #2 can load their deletes independentl= y, > without worrying about double row outputs). > > If a delete delta which was loaded is not found in the input split, it ha= s > no effect on the reader's output correctness. > > > I don=E2=80=99t like that the user has to make a different call in the = acid case. > > You need to identify within ORC whether the file provided is a base file > or a delta insert file. > > If the file is a base_xx, then all deletes exist in ./delete_deltas_*/ > > if the file is named delta_xx, then all deletes exist in ../delete_deltas= */ > > Those are strictly enforced by the ACID implementation & can serve as eas= y > assumptions. > > Other than that, a non-null ValidTxnList is all it should take. > > > the user will already have to have split logic. > > The part where the logic-splits off is into InputFormat - detecting > compaction during split generation is strictly the InputFormat's problem. > > There's a bit of magic there which is in plain sight, like how the INSERT > OVERWRITE works transactionally (HIVE-14988). > > For me, the clear division is to look at this problem as "Details about > file names" (includes HIVE-14535) and "Details about a Stripe" (Reader + > valid-txns + deletes application). > > Everything in the middle is just the same as regular ORC, like PPD. > > From the other side of the mirror, the flat ORC API is pretty much a Null > ROW__ID pruned already, with 0 deletes and Long.MAX watermark in the > ReaderOptions. > > > implementation of Reader and RecordReader that understand acid > > There's an "*" to most of the above - a reader which intends to modify th= e > data might need a different API, to be explicit that the ROW__ID is > projected out to the user. > > Cheers, > Gopal > > > > On 9/13/17, 3:48 PM, "Alan Gates" wrote: > > I=E2=80=99ve been looking at the OrcFile.createReader method and thin= king about > what I will need to do to read acid files. The first thing that > strikes me > is that createReader takes a file. But for acid, you need to pass th= e > directory because it needs to look for any relevant delta files. Aci= d > also > requires a ValidTxnList. We can add that to the ReaderOptions. > > It seems the best way to do this is to add a new method > OrcFile.createAcidReader that takes a directory. I don=E2=80=99t lik= e that the > user has to make a different call in the acid case. But the user wil= l > have > to set the ValidTxnList in the reader options anyway, so the user wil= l > already have to have split logic. > > Every way I could think of for createReader to decide if it was deali= ng > with an acid directory or a non-acid file seemed to create jumbled > semantics. > Does the user pass a directory for the acid case but a file for > non-acid? > Yuck. > Does the user pass a base file in the acid case and the code walks up > the > path to find the relevant directory? Seems error prone and slow. > > Related to this is my assumption that I will need to write a new > implementation of Reader and RecordReader that understand acid. This > seems > better than putting a bunch of branches into the existing code to try > to > handle both cases. > > Thoughts? > > Alan. > > > > --94eb2c03ca7a55576f05592968a4--