carbondata-issues mailing list archives

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

    https://github.com/apache/carbondata/pull/1011#discussion_r121313545
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
---
    @@ -179,6 +193,21 @@ object CommonUtil {
         isValid
       }
     
    +  def validateTypeConvert(desType: Option[String], value: String): Boolean = {
    +    val result = desType match {
    +      case Some("IntegerType") => scala.util.Try(value.trim().toInt)
    +      case Some("LongType") => scala.util.Try(value.trim().toLong)
    +      case Some("FloatType") => scala.util.Try(value.trim().toFloat)
    +      case Some("DoubleType") => scala.util.Try(value.trim().toDouble)
    +      case Some("ByteType") => scala.util.Try(value.trim().toByte)
    +      case Some("ShortType") => scala.util.Try(value.trim().toShort)
    +      case Some("DecimalType") => scala.util.Try(value.trim().toDouble)
    --- End diff --
    
    time stamp and date are not validated. 
    Go through the complete list of supported data types and handle accordingly


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