Calcite support overview

Apache Calcite is a widespread SQL dialect used in big data processing with some streaming enhancements. Calcite provides the basic dialect underlying Beam SQL.

We have added additional extensions to make it easy to leverage Beam’s unified batch/streaming model and support for complex data types.

Query syntax

Query statements scan one or more tables or expressions and return the computed result rows. The Query syntax page describes Beam SQL’s syntax for queries when using Apache Calcite.

Lexical structure

A Beam SQL statement comprises a series of tokens. The Lexical structure page documents Beam SQL’s lexical structure when using Apache Calcite.

Data types

Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows. Read about supported data types in Beam SQL when using Apache Calcite.

Functions and operators

The following table summarizes Apache Calcite operators and functions supported by Beam SQL.

Operators and functionsBeam SQL support status
Operator precedenceYes
Comparison operatorsSee Beam SQL scalar functions
Logical operatorsSee Beam SQL scalar functions
Arithmetic operators and functionsSee Beam SQL scalar functions
Character string operators and functionsSee Beam SQL scalar functions
Binary string operators and functionsNo
Date/time functionsSee Beam SQL scalar functions
System functionsNo
Conditional functions and operatorsSee Beam SQL scalar functions
Type conversionYes
Value constructorsNo, except array
Collection functionsNo
Period predicatesNo
JDBC function escapeNo
Aggregate functions See Beam SQL extension aggregate functions
Window functionsNo
Grouping functionsNo
Grouped window functionsSee Beam SQL extension windowing and triggering
Grouped auxiliary functionsYes, except SESSION_END
Spatial functionsNo
Geometry creation functions (3D)No
Geometry predicatesNo
JSON functionsNo
User-defined functions See Beam SQL extension user-defined functions. You cannot call functions with named and optional parameters.
MATCH_RECOGNIZENo
DDL ExtensionsSee Beam SQL extension CREATE EXTERNAL TABLE