Skip to content

Commit

Permalink
support empty array expression in presto
Browse files Browse the repository at this point in the history
  • Loading branch information
nooberfsh committed Jan 2, 2022
1 parent 2927588 commit f958526
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit f958526

Please sign in to comment.