PR improves parsing BigQuery control structures so that they're fully detected as their own potential standalone statements. Unlike Oracle, BigQuery's procedural language can be used without first using DECLARE or SET or BEGIN and can be completely standalone, and so we need to be able to detect that these are separate statements, and not part of a larger ANON_BLOCK like Oracle. BEGIN though for BigQuery can start an anon_block if it's the first word, and not followed by "TRANSACTION" which gives similar behavior as Oracle for that.
See CASE or FOR in the below examples as statements that are completely standalone. The other loop structures probably expect a DECLARE or SET before it, but there's no guarantee.
PR improves parsing BigQuery control structures so that they're fully detected as their own potential standalone statements. Unlike Oracle, BigQuery's procedural language can be used without first using
DECLARE
orSET
orBEGIN
and can be completely standalone, and so we need to be able to detect that these are separate statements, and not part of a largerANON_BLOCK
like Oracle.BEGIN
though for BigQuery can start an anon_block if it's the first word, and not followed by"TRANSACTION"
which gives similar behavior as Oracle for that.See
CASE
orFOR
in the below examples as statements that are completely standalone. The other loop structures probably expect aDECLARE
orSET
before it, but there's no guarantee.