Skip to content

Commit f958526

Browse files
committed
support empty array expression in presto
1 parent 2927588 commit f958526

File tree

2 files changed

+2
-1
lines changed
  • dialects/presto/src/Database/Sql/Presto
  • test/Database/Sql/Presto/Parser

2 files changed

+2
-1
lines changed

dialects/presto/src/Database/Sql/Presto/Parser.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ arrayPrimaryExprP :: Parser (Expr RawNames Range)
948948
arrayPrimaryExprP = do
949949
r <- Tok.arrayP
950950
_ <- Tok.openBracketP
951-
exprs <- exprP `sepBy1` Tok.commaP
951+
exprs <- exprP `sepBy` Tok.commaP
952952
r' <- Tok.closeBracketP
953953
return $ ArrayExpr (r <> r') exprs
954954

test/Database/Sql/Presto/Parser/Test.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ testParser = test
119119
, "SELECT CURRENT_TIME(1);"
120120
, "SELECT CURRENT_DATE;"
121121
, "SELECT ARRAY[1+1, LOCALTIME];"
122+
, "SELECT ARRAY[];"
122123
, "SELECT CAST(NULL AS BIGINT);"
123124
, "SELECT TRY_CAST(NULL AS BIGINT);"
124125
, "SELECT TRY_CAST(NULL AS BIGINT ARRAY);"

0 commit comments

Comments
 (0)