Skip to content

Commit

Permalink
Add DataType for SqlParser
Browse files Browse the repository at this point in the history
  • Loading branch information
chenghao-intel committed Apr 3, 2014
1 parent ce4385e commit 8a1d4d6
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ class SqlParser extends StandardTokenParsers {
protected val RIGHT = Keyword("RIGHT")
protected val SELECT = Keyword("SELECT")
protected val STRING = Keyword("STRING")
protected val FLOAT = Keyword("FLOAT")
protected val SMALLINT = Keyword("SMALLINT")
protected val TINYINT = Keyword("TINYINT")
protected val INT = Keyword("INT")
protected val BIGINT = Keyword("BIGINT")
protected val DECIMAL = Keyword("DECIMAL")
protected val DOUBLE = Keyword("DOUBLE")
protected val BOOLEAN = Keyword("BOOLEAN")
protected val BINARY = Keyword("BINARY")
protected val TIMESTAMP = Keyword("TIMESTAMP")
protected val SUM = Keyword("SUM")
protected val TRUE = Keyword("TRUE")
protected val UNION = Keyword("UNION")
Expand Down Expand Up @@ -338,5 +348,15 @@ class SqlParser extends StandardTokenParsers {
literal

protected lazy val dataType: Parser[DataType] =
STRING ^^^ StringType
STRING ^^^ StringType |
FLOAT ^^^ FloatType |
TINYINT ^^^ ByteType |
SMALLINT ^^^ ShortType |
INT ^^^ IntegerType |
BIGINT ^^^ LongType |
DECIMAL ^^^ DecimalType |
DOUBLE ^^^ DoubleType |
BOOLEAN ^^^ BooleanType |
BINARY ^^^ BinaryType |
TIMESTAMP ^^^ TimestampType
}

0 comments on commit 8a1d4d6

Please sign in to comment.