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 A7348200D01 for ; Fri, 22 Sep 2017 12:58:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A57C71609BE; Fri, 22 Sep 2017 10:58:29 +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 EB35C1609A7 for ; Fri, 22 Sep 2017 12:58:28 +0200 (CEST) Received: (qmail 18230 invoked by uid 500); 22 Sep 2017 10:58:28 -0000 Mailing-List: contact commits-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list commits@carbondata.apache.org Received: (qmail 18221 invoked by uid 99); 22 Sep 2017 10:58:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Sep 2017 10:58:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDB47F576A; Fri, 22 Sep 2017 10:58:26 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ravipesala@apache.org To: commits@carbondata.apache.org Message-Id: <89a24b1030c74e7293254467fa5bf101@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: carbondata git commit: [CARBONDATA-1509] Fixed bug for maintaining compatibility of decimal type with older releases of Carbondata Date: Fri, 22 Sep 2017 10:58:26 +0000 (UTC) archived-at: Fri, 22 Sep 2017 10:58:29 -0000 Repository: carbondata Updated Branches: refs/heads/master 80fa37c55 -> 7f6b08a2b [CARBONDATA-1509] Fixed bug for maintaining compatibility of decimal type with older releases of Carbondata In old Carbondata releases, precision and scale is not stored for decimal data type and both values are initialized to -1. In TableSpec.ColumnSpec default values for precision and scale are initialized to 0 because of which exception is thrown while reading the old store with decimal column. Both precision and scale should be initialized to -1. This closes #1378 Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/7f6b08a2 Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/7f6b08a2 Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/7f6b08a2 Branch: refs/heads/master Commit: 7f6b08a2b5b13799a2a0bbd29d40f45da14d07b1 Parents: 80fa37c Author: manishgupta88 Authored: Fri Sep 22 12:22:39 2017 +0530 Committer: Ravindra Pesala Committed: Fri Sep 22 16:28:05 2017 +0530 ---------------------------------------------------------------------- .../java/org/apache/carbondata/core/datastore/TableSpec.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/carbondata/blob/7f6b08a2/core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java b/core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java index 2fdf82b..b0b62db 100644 --- a/core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java +++ b/core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java @@ -130,7 +130,9 @@ public class TableSpec { } public ColumnSpec(String fieldName, DataType schemaDataType, ColumnType columnType) { - this(fieldName, schemaDataType, columnType, 0, 0); + // for backward compatibility as the precision and scale is not stored, the values should be + // initialized with -1 for both precision and scale + this(fieldName, schemaDataType, columnType, -1, -1); } public ColumnSpec(String fieldName, DataType schemaDataType, ColumnType columnType,