carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manishgupta88 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1023: [carbondata-1149] Fix issue of mismatch type ...
Date Wed, 14 Jun 2017 05:16:52 GMT
Github user manishgupta88 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1023#discussion_r121855817
  
    --- 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)
    +      case Some("LongType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.LONG)
    +      case Some("FloatType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.FLOAT)
    +      case Some("DoubleType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.DOUBLE)
    +      case Some("ByteType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.BYTE)
    +      case Some("ShortType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.SHORT)
    +      case Some("BooleanType") =>
    +        DataTypeUtil.getDataBasedOnDataType(value.trim, DataType.BOOLEAN)
    +      case Some("DecimalType") =>
    --- End diff --
    
    DecimalType comes with precision and scale like DecimalType(10,0)...so validation for
decimal type will fail here....Please correct the validation logic for DecimalType


---
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.
---

Mime
View raw message