Beam ZetaSQL overview

Beam SQL supports a variant of the ZetaSQL language. ZetaSQL is similar to the language in BigQuery’s SQL framework. This Beam SQL dialect is especially useful in pipelines that write to or read from BigQuery tables.

Beam SQL has additional extensions leveraging Beam’s unified batch/streaming model and processing complex data types. You can use these extensions with all Beam SQL dialects, including Beam ZetaSQL.

Query syntax

Query statements scan tables or expressions and return the computed result rows. For more information about query statements in Beam ZetaSQL, see the Query syntax reference and Function call rules.

Lexical structure

A Beam SQL statement comprises a series of tokens. For more information about tokens in Beam ZetaSQL, see the Lexical structure reference.

Data types

Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows. For more information about scalar data in Beam ZetaSQL, see the Data types reference.

Functions and operators

For a list of the built-in functions and operators supported in Beam ZetaSQL, see SupportedZetaSqlBuiltinFunctions.java (commented-out entries are not yet supported). For documentation on how these functions work, see the ZetaSQL functions and operators reference.