carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [09/14] incubator-carbondata git commit: not to remove blank in string
Date Mon, 08 May 2017 09:48:21 GMT
not to remove blank in string


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/46ab7142
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/46ab7142
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/46ab7142

Branch: refs/heads/12-dev
Commit: 46ab714256eb486d58b359e66f05fc15e8f3680d
Parents: f6fe9dc
Author: lionelcao <whucaolu@gmail.com>
Authored: Sun May 7 21:02:07 2017 +0800
Committer: lionelcao <whucaolu@gmail.com>
Committed: Sun May 7 21:02:07 2017 +0800

----------------------------------------------------------------------
 .../carbondata/examples/CarbonPartitionExample.scala    |  2 +-
 .../apache/spark/sql/catalyst/CarbonDDLSqlParser.scala  | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/46ab7142/examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
----------------------------------------------------------------------
diff --git a/examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
b/examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
index 6b1b54e..72ccef8 100644
--- a/examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
+++ b/examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
@@ -113,7 +113,7 @@ object CarbonPartitionExample {
        | PARTITIONED BY (country string)
        | STORED BY 'carbondata'
        | TBLPROPERTIES('PARTITION_TYPE'='LIST',
-       | 'LIST_INFO'='(china,usa),uk,japan,(canada,russia), korea ')
+       | 'LIST_INFO'='(China,United States),UK ,japan,(Canada,Russia), South Korea ')
        """.stripMargin)
 
     // spark.sql(s"""

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/46ab7142/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
b/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
index 3ccfbb1..2fbd003 100644
--- a/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
+++ b/integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
@@ -374,19 +374,19 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser
{
       hashNumber = tableProperties.get(CarbonCommonConstants.HASH_NUMBER).get.toInt
     }
     if (tableProperties.get(CarbonCommonConstants.RANGE_INFO).isDefined) {
-      rangeInfo = tableProperties.get(CarbonCommonConstants.RANGE_INFO).get.replace(" ",
"")
-        .split(",").toList
+      rangeInfo = tableProperties.get(CarbonCommonConstants.RANGE_INFO).get.split(",")
+        .map(_.trim()).toList
     }
     if (tableProperties.get(CarbonCommonConstants.LIST_INFO).isDefined) {
-      val arr = tableProperties.get(CarbonCommonConstants.LIST_INFO).get
-                      .replace(" ", "").split(",")
+      val arr = tableProperties.get(CarbonCommonConstants.LIST_INFO).get.split(",")
+        .map(_.trim())
       val iter = arr.iterator
       while(iter.hasNext) {
         val value = iter.next()
         if (value.startsWith("(")) {
-          templist += value.replace("(", "")
+          templist += value.replace("(", "").trim()
         } else if (value.endsWith(")")) {
-          templist += value.replace(")", "")
+          templist += value.replace(")", "").trim()
           listInfo += templist.toList
           templist.clear()
         } else {


Mime
View raw message