You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2015/04/11 23:53:12 UTC

spark git commit: [SPARK-6611][SQL] Add support for INTEGER as synonym of INT.

Repository: spark
Updated Branches:
  refs/heads/master 198cf2a3f -> 5f7b7cdab


[SPARK-6611][SQL] Add support for INTEGER as synonym of INT.

https://issues.apache.org/jira/browse/SPARK-6611

Author: Santiago M. Mola <sa...@sap.com>

Closes #5271 from smola/features/integer-parse and squashes the following commits:

f5c1c64 [Santiago M. Mola] [SPARK-6611] Add support for INTEGER as synonym of INT.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/5f7b7cda
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/5f7b7cda
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/5f7b7cda

Branch: refs/heads/master
Commit: 5f7b7cdab41002ad291f0a1ba7777cfff21d0019
Parents: 198cf2a
Author: Santiago M. Mola <sa...@sap.com>
Authored: Sat Apr 11 14:52:49 2015 -0700
Committer: Michael Armbrust <mi...@databricks.com>
Committed: Sat Apr 11 14:52:49 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala | 2 +-
 .../scala/org/apache/spark/sql/types/DataTypeParserSuite.scala     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/5f7b7cda/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala
index 34270d0..5163f05 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeParser.scala
@@ -40,7 +40,7 @@ private[sql] trait DataTypeParser extends StandardTokenParsers {
   protected lazy val primitiveType: Parser[DataType] =
     "(?i)string".r ^^^ StringType |
     "(?i)float".r ^^^ FloatType |
-    "(?i)int".r ^^^ IntegerType |
+    "(?i)(?:int|integer)".r ^^^ IntegerType |
     "(?i)tinyint".r ^^^ ByteType |
     "(?i)smallint".r ^^^ ShortType |
     "(?i)double".r ^^^ DoubleType |

http://git-wip-us.apache.org/repos/asf/spark/blob/5f7b7cda/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeParserSuite.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeParserSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeParserSuite.scala
index 1ba21b6..1691252 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeParserSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/types/DataTypeParserSuite.scala
@@ -34,10 +34,12 @@ class DataTypeParserSuite extends FunSuite {
   }
 
   checkDataType("int", IntegerType)
+  checkDataType("integer", IntegerType)
   checkDataType("BooLean", BooleanType)
   checkDataType("tinYint", ByteType)
   checkDataType("smallINT", ShortType)
   checkDataType("INT", IntegerType)
+  checkDataType("INTEGER", IntegerType)
   checkDataType("bigint", LongType)
   checkDataType("float", FloatType)
   checkDataType("dOUBle", DoubleType)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org