Skip to content
Prev Previous commit
support empty array expression in presto
  • Loading branch information
nooberfsh committed Jan 19, 2022
commit 5a4d65f3304868939e84dc1d0763665c1568231a
2 changes: 1 addition & 1 deletion dialects/presto/src/Database/Sql/Presto/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ arrayPrimaryExprP :: Parser (Expr RawNames Range)
arrayPrimaryExprP = do
r <- Tok.arrayP
_ <- Tok.openBracketP
exprs <- exprP `sepBy1` Tok.commaP
exprs <- exprP `sepBy` Tok.commaP
r' <- Tok.closeBracketP
return $ ArrayExpr (r <> r') exprs

Expand Down
1 change: 1 addition & 0 deletions test/Database/Sql/Presto/Parser/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ testParser = test
, "SELECT CURRENT_TIME(1);"
, "SELECT CURRENT_DATE;"
, "SELECT ARRAY[1+1, LOCALTIME];"
, "SELECT ARRAY[];"
, "SELECT CAST(NULL AS BIGINT);"
, "SELECT TRY_CAST(NULL AS BIGINT);"
, "SELECT TRY_CAST(NULL AS BIGINT ARRAY);"
Expand Down