From issues-return-48737-archive-asf-public=cust-asf.ponee.io@drill.apache.org Fri Jan 12 14:06:13 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 8BD82180621 for ; Fri, 12 Jan 2018 14:06:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7A766160C33; Fri, 12 Jan 2018 13:06:13 +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 C0E8B160C30 for ; Fri, 12 Jan 2018 14:06:12 +0100 (CET) Received: (qmail 56603 invoked by uid 500); 12 Jan 2018 13:06:11 -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 56593 invoked by uid 99); 12 Jan 2018 13:06:11 -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; Fri, 12 Jan 2018 13:06:11 +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 678A3180985 for ; Fri, 12 Jan 2018 13:06:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -107.911 X-Spam-Level: X-Spam-Status: No, score=-107.911 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, 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-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id qqp9VowA_XHi for ; Fri, 12 Jan 2018 13:06:10 +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 EE85A5F47E for ; Fri, 12 Jan 2018 13:06:09 +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 3EF10E2584 for ; Fri, 12 Jan 2018 13:06:08 +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 031EE25BDB for ; Fri, 12 Jan 2018 13:06:01 +0000 (UTC) Date: Fri, 12 Jan 2018 13:06:01 +0000 (UTC) From: "Volodymyr Vysotskyi (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (DRILL-5690) RepeatedDecimal18Vector does not pass scale, precision to data vector 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-5690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Volodymyr Vysotskyi resolved DRILL-5690. ---------------------------------------- Resolution: Fixed Fixed in https://github.com/apache/drill/commit/40de8ca4f47533fa6593d1266403868ae1a2119f > RepeatedDecimal18Vector does not pass scale, precision to data vector > --------------------------------------------------------------------- > > Key: DRILL-5690 > URL: https://issues.apache.org/jira/browse/DRILL-5690 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.10.0 > Reporter: Paul Rogers > Assignee: Paul Rogers > Fix For: 1.13.0 > > > Decimal types require not just the type (Decimal9, Decimal18, etc.) but also a precision and scale. The triple of (minor type, precision, scale) appears in the {{MaterializedField}} for the nullable or required vectors. > A repeated vector has three parts: the {{RepeatedDecimal18Vector}} which is composed of a {{UInt4Vector}} offset vector and a {{Decimal18Vector}} that holds values. > When {{RepeatedDecimal18Vector}} creates the {{Decimal18Vector}} to hold the values, it clones the {{MaterializedField}}. But, it *does not* clone the scale and precision, resulting in the loss of critical information. > {code} > public RepeatedDecimal18Vector(MaterializedField field, BufferAllocator allocator) { > super(field, allocator); > addOrGetVector(VectorDescriptor.create(Types.required(field.getType().getMinorType()))); > } > {code} > This is normally not a problem because most code access the data via the repeated vector. But, for code that needs to work with the values, the results are wrong given that the types are wrong. (Values stored with one scale, 123.45, (scale 2) will be retrieved with 0 scale (123, say). -- This message was sent by Atlassian JIRA (v6.4.14#64029)