Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2990#discussion_r242030254
  
    --- Diff: 
integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
 ---
    @@ -1464,31 +1464,46 @@ abstract class CarbonDDLSqlParser extends 
AbstractCarbonSparkSQLParser {
        * @param values
        * @return
        */
    -  def parseDataType(dataType: String, values: Option[List[(Int, Int)]]): 
DataTypeInfo = {
    +  def parseDataType(
    +      dataType: String,
    +      values: Option[List[(Int, Int)]],
    +      isColumnRename: Boolean): DataTypeInfo = {
    +    def validateAndGetDecimalDatatype: DataTypeInfo = {
    +      var precision: Int = 0
    +      var scale: Int = 0
    +      if (values.isDefined) {
    +        precision = values.get(0)._1
    +        scale = values.get(0)._2
    +      } else {
    +        throw new MalformedCarbonCommandException("Decimal format provided 
is invalid")
    +      }
    +      // precision should be > 0 and <= 38 and scale should be >= 0 and <= 
38
    +      if (precision < 1 || precision > 38) {
    --- End diff --
    
    since the number is fixed, i havent changed the old code, no need to define 
constants, so i kept teh same as old


---

Reply via email to