Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1011#discussion_r121313427
--- 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 --
This has to be verified with respect to precision and scale.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---