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 D619C200CA7 for ; Wed, 14 Jun 2017 08:27:44 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D4D24160BDB; Wed, 14 Jun 2017 06:27:44 +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 4DD21160BCB for ; Wed, 14 Jun 2017 08:27:44 +0200 (CEST) Received: (qmail 10068 invoked by uid 500); 14 Jun 2017 06:27:43 -0000 Mailing-List: contact issues-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 issues@carbondata.apache.org Received: (qmail 10059 invoked by uid 99); 14 Jun 2017 06:27:43 -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; Wed, 14 Jun 2017 06:27:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61417DFB92; Wed, 14 Jun 2017 06:27:43 +0000 (UTC) From: manishgupta88 To: issues@carbondata.apache.org Reply-To: issues@carbondata.apache.org References: In-Reply-To: Subject: [GitHub] carbondata pull request #1023: [carbondata-1149] Fix issue of mismatch type ... Content-Type: text/plain Message-Id: <20170614062743.61417DFB92@git1-us-west.apache.org> Date: Wed, 14 Jun 2017 06:27:43 +0000 (UTC) archived-at: Wed, 14 Jun 2017 06:27:45 -0000 Github user manishgupta88 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1023#discussion_r121863383 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala --- @@ -179,6 +193,68 @@ object CommonUtil { isValid } + def validateTypeConvert(desType: Option[String], value: String): Boolean = { + var flag = true + val result = desType match { + case Some("IntegerType") => + DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.INT) + case Some("StringType") => + DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.STRING) --- End diff -- Please correct me if I am wrong....While validating the values you are trimming the values but in the actual range info can still contain the spaces as the object is not getting refilled with the trimmed values and therefore can lead to an inconsistent state. For e.g I have Int type column with rangeInfo = 1, 2 , 3,4...while parsing it will pass as trim function is used but original object still will have the same values... --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---