From issues-return-51528-archive-asf-public=cust-asf.ponee.io@drill.apache.org Sun Apr 1 03:05:09 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7CEED18064A for ; Sun, 1 Apr 2018 03:05:08 +0200 (CEST) Received: (qmail 77057 invoked by uid 500); 1 Apr 2018 01:05:07 -0000 Mailing-List: contact issues-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 issues@drill.apache.org Received: (qmail 77048 invoked by uid 99); 1 Apr 2018 01:05:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2018 01:05:07 +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 0861C18015D for ; Sun, 1 Apr 2018 01:05:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-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 TXp87Ldqtd6u for ; Sun, 1 Apr 2018 01:05:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D9CFA5F11F for ; Sun, 1 Apr 2018 01:05:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6A54EE00A6 for ; Sun, 1 Apr 2018 01:05:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 361C5255F9 for ; Sun, 1 Apr 2018 01:05:00 +0000 (UTC) Date: Sun, 1 Apr 2018 01:05:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-6230) Extend row set readers to handle hyper vectors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-6230?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1642= 1541#comment-16421541 ]=20 ASF GitHub Bot commented on DRILL-6230: --------------------------------------- Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/1161#discussion_r178445424 =20 --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/rowSet/Hyp= erRowSetImpl.java --- @@ -45,8 +50,67 @@ public RowSetReader buildReader(HyperRowSet rowSet, = SelectionVector4 sv4) { TupleMetadata schema =3D rowSet.schema(); HyperRowIndex rowIndex =3D new HyperRowIndex(sv4); return new RowSetReaderImpl(schema, rowIndex, - buildContainerChildren(rowSet.container(), - new MetadataRetrieval(schema))); + buildContainerChildren(rowSet.container(), schema)); + } + } + + public static class HyperRowSetBuilderImpl implements HyperRowSetBui= lder { + + private final BufferAllocator allocator; + private final List batches =3D new ArrayList<>(); + private int totalRowCount; + + public HyperRowSetBuilderImpl(BufferAllocator allocator) { + this.allocator =3D allocator; + } + + @Override + public void addBatch(SingleRowSet rowSet) { + if (rowSet.rowCount() =3D=3D 0) { + return; + } + if (rowSet.indirectionType() !=3D SelectionVectorMode.NONE) { + throw new IllegalArgumentException("Batches must not have a se= lection vector."); + } + batches.add(rowSet.container()); + totalRowCount +=3D rowSet.rowCount(); + } + + @Override + public void addBatch(VectorContainer container) { + if (container.getRecordCount() =3D=3D 0) { + return; + } + if (container.getSchema().getSelectionVectorMode() !=3D Selectio= nVectorMode.NONE) { + throw new IllegalArgumentException("Batches must not have a se= lection vector."); + } + batches.add(container); + totalRowCount +=3D container.getRecordCount(); + } + + @SuppressWarnings("resource") + @Override + public HyperRowSet build() throws SchemaChangeException { + SelectionVector4 sv4 =3D new SelectionVector4(allocator, totalRo= wCount); + ExpandableHyperContainer hyperContainer =3D new ExpandableHyperC= ontainer(); + for (VectorContainer container : batches) { + hyperContainer.addBatch(container); + } + + // TODO: This has a bug. If the hyperset has two batches with un= ions, + // and the first union contains only VARCHAR, while the second c= ontains --- End diff -- =20 [DRILL-6304](https://issues.apache.org/jira/browse/DRILL-6304) > Extend row set readers to handle hyper vectors > ---------------------------------------------- > > Key: DRILL-6230 > URL: https://issues.apache.org/jira/browse/DRILL-6230 > Project: Apache Drill > Issue Type: Improvement > Reporter: Paul Rogers > Assignee: Paul Rogers > Priority: Major > Fix For: 1.14.0 > > > The current row set readers have incomplete support for hyper-vectors. To= add full support, we need an interface that supports either single batches= or hyper batches. Accessing vectors in hyper batches differs depending on = whether the vector is at the top level or is nested. See=C2=A0[this post|ht= tps://github.com/paul-rogers/drill/wiki/BH-Column-Readers] for details. Als= o includes a simpler reader template: replaces the original three classes w= ith one, in parallel with the writers. -- This message was sent by Atlassian JIRA (v7.6.3#76005)