carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [20/56] [abbrv] carbondata git commit: partitioned by all primitive data type
Date Tue, 20 Jun 2017 07:29:26 GMT
http://git-wip-us.apache.org/repos/asf/carbondata/blob/de5346f3/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala
b/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala
index 566347f..fef542a 100644
--- a/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala
+++ b/integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/DataTypeConverterUtil.scala
@@ -21,6 +21,9 @@ import org.apache.carbondata.core.metadata.datatype.DataType
 import org.apache.carbondata.format.{DataType => ThriftDataType}
 
 object DataTypeConverterUtil {
+  val FIXED_DECIMAL = """decimal\(\s*(\d+)\s*,\s*(\-?\d+)\s*\)""".r
+  val FIXED_DECIMALTYPE = """decimaltype\(\s*(\d+)\s*,\s*(\-?\d+)\s*\)""".r
+
   def convertToCarbonType(dataType: String): DataType = {
     dataType.toLowerCase match {
       case "string" => DataType.STRING
@@ -34,6 +37,7 @@ object DataTypeConverterUtil {
       case "double" => DataType.DOUBLE
       case "float" => DataType.DOUBLE
       case "decimal" => DataType.DECIMAL
+      case FIXED_DECIMAL(_, _) => DataType.DECIMAL
       case "timestamp" => DataType.TIMESTAMP
       case "date" => DataType.DATE
       case "array" => DataType.ARRAY
@@ -55,6 +59,7 @@ object DataTypeConverterUtil {
       case "doubletype" => DataType.DOUBLE
       case "floattype" => DataType.DOUBLE
       case "decimaltype" => DataType.DECIMAL
+      case FIXED_DECIMALTYPE(_, _) => DataType.DECIMAL
       case "timestamptype" => DataType.TIMESTAMP
       case "datetype" => DataType.DATE
       case others =>

http://git-wip-us.apache.org/repos/asf/carbondata/blob/de5346f3/integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
b/integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
index 580dcc6..ee999a4 100644
--- a/integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
+++ b/integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
@@ -1006,7 +1006,7 @@ object CarbonDataRDDFactory {
     val columns = carbonLoadModel.getCsvHeaderColumns
     var partitionColumnIndex = -1
     for (i <- 0 until columns.length) {
-      if (partitionColumn.equals(columns(i))) {
+      if (partitionColumn.equalsIgnoreCase(columns(i))) {
         partitionColumnIndex = i
       }
     }

http://git-wip-us.apache.org/repos/asf/carbondata/blob/de5346f3/integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
b/integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
index 2e8e024..93d790b 100644
--- a/integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
+++ b/integration/spark2/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
@@ -1030,7 +1030,7 @@ object CarbonDataRDDFactory {
     val columns = carbonLoadModel.getCsvHeaderColumns
     var partitionColumnIndex = -1
     for (i <- 0 until columns.length) {
-      if (partitionColumn.equals(columns(i))) {
+      if (partitionColumn.equalsIgnoreCase(columns(i))) {
         partitionColumnIndex = i
       }
     }


Mime
View raw message