Skip to content

Commit ad71c92

Browse files
committed
to fix parser specifications
1 parent b6605e7 commit ad71c92

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sql/src/main/scala/app/softnetwork/elastic/sql/SQLParser.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ trait SQLParser extends RegexParsers with PackratParsers {
382382
"int",
383383
"integer",
384384
"long",
385+
"bigint",
385386
"double",
386387
"boolean",
387388
"time",
@@ -434,7 +435,7 @@ trait SQLParser extends RegexParsers with PackratParsers {
434435
def boolean_type: PackratParser[SQLTypes.Boolean.type] =
435436
"(?i)boolean".r ^^ (_ => SQLTypes.Boolean)
436437

437-
def long_type: PackratParser[SQLTypes.BigInt.type] = "(?i)long".r ^^ (_ => SQLTypes.BigInt)
438+
def long_type: PackratParser[SQLTypes.BigInt.type] = "(?i)long|bigint".r ^^ (_ => SQLTypes.BigInt)
438439

439440
def double_type: PackratParser[SQLTypes.Double.type] = "(?i)double".r ^^ (_ => SQLTypes.Double)
440441

sql/src/test/scala/app/softnetwork/elastic/sql/SQLParserSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ object Queries {
142142
val nullif: String =
143143
"select coalesce(nullif(createdAt, parse_date('2025-09-11', 'yyyy-MM-dd') - interval 2 day), current_date) as c, identifier from Table"
144144
val cast: String =
145-
"select cast(coalesce(nullif(createdAt, parse_date('2025-09-11', 'yyyy-MM-dd')), current_date - interval 2 hour) long) as c, identifier from Table"
145+
"select cast(coalesce(nullif(createdAt, parse_date('2025-09-11', 'yyyy-MM-dd')), current_date - interval 2 hour) bigint) as c, identifier from Table"
146146
}
147147

148148
/** Created by smanciot on 15/02/17.

0 commit comments

Comments
 (0)