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 564CA200CE0 for ; Thu, 27 Jul 2017 03:27:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 54BC0169F0C; Thu, 27 Jul 2017 01:27:10 +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 9A97A169F0B for ; Thu, 27 Jul 2017 03:27:09 +0200 (CEST) Received: (qmail 44652 invoked by uid 500); 27 Jul 2017 01:27:03 -0000 Mailing-List: contact dev-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 dev@drill.apache.org Received: (qmail 44634 invoked by uid 99); 27 Jul 2017 01:27:03 -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, 27 Jul 2017 01:27:03 +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 3DB8BC2424 for ; Thu, 27 Jul 2017 01:27:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Zo9w8GTSA5FM for ; Thu, 27 Jul 2017 01:27:02 +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 192DC61067 for ; Thu, 27 Jul 2017 01:27: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 91223E0BDF for ; Thu, 27 Jul 2017 01:27: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 3B80324818 for ; Thu, 27 Jul 2017 01:27:00 +0000 (UTC) Date: Thu, 27 Jul 2017 01:27:00 +0000 (UTC) From: "Paul Rogers (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (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 archived-at: Thu, 27 Jul 2017 01:27:10 -0000 Paul Rogers created DRILL-5690: ---------------------------------- Summary: 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.12.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)