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 7F4C3200CEF for ; Mon, 4 Sep 2017 19:40:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7DBCA165325; Mon, 4 Sep 2017 17:40:19 +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 C4FA7165320 for ; Mon, 4 Sep 2017 19:40:18 +0200 (CEST) Received: (qmail 24853 invoked by uid 500); 4 Sep 2017 17:40:16 -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 24844 invoked by uid 99); 4 Sep 2017 17:40:16 -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; Mon, 04 Sep 2017 17:40:16 +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 52D59D3D79 for ; Mon, 4 Sep 2017 17:40:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled 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 zaGJpCqq8qAj for ; Mon, 4 Sep 2017 17:40:11 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AA6C46114D for ; Mon, 4 Sep 2017 17:31:01 +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 A0490E087D for ; Mon, 4 Sep 2017 17:31: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 55F6324147 for ; Mon, 4 Sep 2017 17:31:00 +0000 (UTC) Date: Mon, 4 Sep 2017 17:31:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5709) Provide a value vector method to convert a vector to nullable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 04 Sep 2017 17:40:19 -0000 [ https://issues.apache.org/jira/browse/DRILL-5709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152814#comment-16152814 ] ASF GitHub Bot commented on DRILL-5709: --------------------------------------- Github user asfgit closed the pull request at: https://github.com/apache/drill/pull/901 > Provide a value vector method to convert a vector to nullable > ------------------------------------------------------------- > > Key: DRILL-5709 > URL: https://issues.apache.org/jira/browse/DRILL-5709 > Project: Apache Drill > Issue Type: Improvement > Reporter: Paul Rogers > Assignee: Paul Rogers > Priority: Minor > Labels: ready-to-commit > Fix For: 1.12.0 > > > The hash agg spill work has need to convert a non-null scalar vector to the nullable equivalent. For efficiency, the code wishes to simply transfer the underlying data buffer(s), and create the required "bits" vector, rather than generating code that does the transfer row-by-row. > The solution is to add a {{toNullable(ValueVector nullableVector)}} method to the {{ValueVector}} class, then implement it where needed. > Since the target code only works with scalars (that is, no arrays, no maps, no lists), the code only handles these cases, throwing an {{UnsupportedOperationException}} in other cases. > Usage: > {code} > ValueVector nonNullableVector = // your non-nullable vector > MajorType type = MajorType.newBuilder(nonNullableVector.getType) > .setMode(DataMode.OPTIONAL) > .build(); > MaterializedField field = MaterializedField.create(name, type); > ValueVector nullableVector = TypeHelper.getNewVector(field, oContext.getAllocator()); > nonNullableVector.toNullable(nullableVector); > // Data is now in nullableVector > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)