Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1AB4818C54 for ; Wed, 29 Jul 2015 20:51:27 +0000 (UTC) Received: (qmail 44715 invoked by uid 500); 29 Jul 2015 20:51:04 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 44687 invoked by uid 500); 29 Jul 2015 20:51:04 -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 44677 invoked by uid 99); 29 Jul 2015 20:51:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jul 2015 20:51:04 +0000 Date: Wed, 29 Jul 2015 20:51:04 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-3313) Eliminate redundant #load methods and unit-test loading & exporting of vectors MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14646743#comment-14646743 ] ASF GitHub Bot commented on DRILL-3313: --------------------------------------- Github user jaltekruse commented on a diff in the pull request: https://github.com/apache/drill/pull/81#discussion_r35810123 --- Diff: exec/java-exec/src/main/codegen/templates/VariableLengthVectors.java --- @@ -119,29 +117,22 @@ public int getVarByteLength(){ @Override public SerializedField getMetadata() { return getMetadataBuilder() // + .addChild(offsetVector.getMetadata()) .setValueCount(getAccessor().getValueCount()) // - .setVarByteLength(getVarByteLength()) // +// .setVarByteLength(getVarByteLength()) // .setBufferLength(getBufferSize()) // .build(); } - public int load(int dataBytes, int valueCount, DrillBuf buf){ - if(valueCount == 0){ - allocateNew(0,0); - return 0; - } - clear(); - int loaded = offsetVector.load(valueCount+1, buf); - data = buf.slice(loaded, dataBytes - loaded); - data.retain(); - return dataBytes; - } - @Override public void load(SerializedField metadata, DrillBuf buffer) { - assert this.field.matches(metadata) : String.format("The field %s doesn't match the provided metadata %s.", this.field, metadata); - int loaded = load(metadata.getBufferLength(), metadata.getValueCount(), buffer); - assert metadata.getBufferLength() == loaded : String.format("Expected to load %d bytes but actually loaded %d bytes", metadata.getBufferLength(), loaded); + final SerializedField offsetField = metadata.getChild(0); --- End diff -- Same as above in regards to these ordinals and their relationship to getMetadataBuilder(). > Eliminate redundant #load methods and unit-test loading & exporting of vectors > ------------------------------------------------------------------------------ > > Key: DRILL-3313 > URL: https://issues.apache.org/jira/browse/DRILL-3313 > Project: Apache Drill > Issue Type: Sub-task > Components: Execution - Data Types > Affects Versions: 1.0.0 > Reporter: Hanifi Gunes > Assignee: Jason Altekruse > Fix For: 1.2.0 > > > Vectors have multiple #load methods that are used to populate data from raw buffers. It is relatively tough to reason, maintain and unit-test loading and exporting of data since there is many redundant code around load methods. This issue proposes to have single #load method conforming to VV#load(def, buffer) signature eliminating all other #load overrides. -- This message was sent by Atlassian JIRA (v6.3.4#6332)