This document provides a detailed feature-by-feature comparison between RisingWave (targeting v2.0) and Apache Flink (targeting v1.20). While both systems excel at stream processing, they have different architectural approaches and feature sets resulting from their different designs: RisingWave as a streaming database and Flink as a stream processing framework. This comparison helps you understand their similarities and differences across various features.

Features noted as “RisingWave-specific” highlight capabilities tied to its database architecture, while “Flink-specific” features reflect its framework nature. Version numbers (RW 2.0, Flink 1.20) are targets; some features might have evolved slightly around these versions. For definitive support details, always consult the official Flink and RisingWave documentation.

Fundamental concepts

RisingWave and Flink share the following core stream processing concepts:

  • Dynamic Tables: Both represent streams as tables that change over time.
  • Continuous Queries: Both execute SQL queries continuously, producing results as input data changes.
  • Time attributes: Both support Event Time (timestamps embedded in data) and Processing Time (the system clock time) for operations such as windowing.
  • Result Update Modes: Both use Append, Update, and Delete semantics to handle changes, which allows them to correctly process changelog streams and maintain state.
  • Deterministic Queries: Both systems aim for deterministic results given the same ordered input events when using event time.

While sharing these fundamentals, their architectures differ: RisingWave stores state internally within its database storage layer, treating streams and materialized views as first-class database objects. Flink typically uses pluggable state backends (such as RocksDB or filesystems), and its connectors manage external storage.

Data types

Both systems support a wide range of standard SQL data types. The following table highlights common types and key differences.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
Fixed-Length
CHARSupportedNot SupportedFixed-length character string.
BINARYSupportedNot SupportedFixed-length binary string.
Variable-Length
VARCHAR/STRINGSupportedSupportedFlink allows specifying a maximum length; RisingWave does not.
VARBINARY/BYTESSupportedBYTEAVariable-length binary string.
Numeric
DECIMALSupportedDECIMAL/NUMERICArbitrary precision numbers.
TINYINTSupportedNot Supported1-byte integer.
SMALLINTSupportedSupported2-byte integer.
INTSupportedSupported4-byte integer.
BIGINTSupportedSupported8-byte integer.
RW_INT256Not SupportedSupported32-byte integer (RisingWave-specific).
FLOATSupportedREAL4-byte floating-point.
DOUBLESupportedDOUBLE PRECISION8-byte floating-point.
Temporal
DATESupportedSupportedCalendar date.
TIMESupportedSupportedTime of day (without timezone).
TIMESTAMPSupportedSupportedTimestamp (without timezone).
TIMESTAMP_LTZSupportedTIMESTAMPTZTimestamp with local timezone interpretation (Flink); Timestamp with timezone, stored as UTC (RisingWave).
INTERVALSupportedSupportedTime interval.
Structured
STRUCTSupportedROWRow type with named fields.
ARRAYSupportedSupportedOrdered collection of elements.
MAPSupportedSupportedKey-value pairs.
MULTISETSupportedNot SupportedUnordered collection allowing duplicates (Flink).
JSONVia FunctionsJSONBFlink typically processes JSON using string functions, while RisingWave offers a native JSONB (binary JSON) type.
Other
BOOLEANSupportedSupportedTrue/False.

Summary: Flink offers fixed-length types and MULTISET. RisingWave provides native JSONB, a large integer type (RW_INT256), and PostgreSQL-compatible naming (REAL, TIMESTAMPTZ, BYTEA). Both support the core data types required for streaming analytics. Timezone handling differs (TIMESTAMP_LTZ vs. TIMESTAMPTZ).

SQL query capabilities

Common SELECT clauses

Flink SQL and RisingWave both support the standard clauses of a SELECT query:

  • WITH (Common Table Expressions)
  • SELECT (including DISTINCT)
  • FROM
  • WHERE
  • GROUP BY (including GROUPING SETS, ROLLUP, and CUBE)
  • HAVING
  • ORDER BY
  • LIMIT

Key differences in SELECT

  • DISTINCT ON: RisingWave supports the PostgreSQL SELECT DISTINCT ON (...) syntax. Flink 1.20 has limited or no support for this specific syntax.
  • Complex Subqueries: Both support subqueries (e.g., in WHERE IN (...), WHERE EXISTS (...), derived tables in FROM). Flink’s SQL planner might optimize certain complex or correlated subquery patterns more effectively.
  • Pattern Matching: Flink provides the MATCH_RECOGNIZE clause for Complex Event Processing (CEP) directly within SQL. RisingWave does not support MATCH_RECOGNIZE.
FeatureFlink (v1.20)RisingWave (v2.0)Notes
DISTINCT ONLimited/NoSupportedPostgreSQL-style unique row selection.
MATCH_RECOGNIZESupportedNot SupportedSQL standard for Complex Event Processing.

Windowing operations

Both systems provide essential windowing capabilities for analyzing data over time or rows.

Window types (Table Value Functions)

Flink uses Table Value Functions (TVFs) like TUMBLE, HOP, SESSION, CUMULATE for windowing aggregations. RisingWave primarily uses standard SQL GROUP BY with time functions or dedicated window syntax where applicable. Support for TVFs is also being added to RisingWave.

Window FeatureFlink (v1.20)RisingWave (v2.0)Notes
Tumbling WindowSupported (TVF)SupportedFixed-size, non-overlapping windows.
Sliding Window (Hop)Supported (TVF)SupportedFixed-size, overlapping windows.
Session WindowSupported (TVF)SupportedWindows defined by gaps of inactivity.
Cumulative WindowSupported (TVF)Not SupportedWindows expanding from a start time to window_end.
Late Data HandlingSupportedSupportedMechanisms to handle data arriving after window close.
Window OffsetSupportedSupportedAdjusting window start/end times.

Window functions (OVER clause)

Both support standard SQL window functions using the OVER clause for calculations across sets of table rows.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
OVER (...)SupportedSupportedDefines the window specification.
RankingSupportedSupportedRANK, DENSE_RANK, ROW_NUMBER, NTILE.
NavigationSupportedSupportedLEAD, LAG.
ValueSupportedSupportedFIRST_VALUE, LAST_VALUE.

Note: Flink’s NTILE is a window function, not directly related to percentile aggregates.

Joins

Both systems support various SQL join types for combining data from multiple streams or tables.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
Regular Joins
INNER JOINSupportedSupported
LEFT JOINSupportedSupported
RIGHT JOINSupportedSupported
FULL JOINSupportedSupported
State Handling NoteConfigurable TTLInternal StorageFlink requires you to configure Time-To-Live (TTL) for join state. RisingWave manages state internally.
Interval JoinSupportedSupportedJoins streams based on time proximity (e.g., t1.time BETWEEN t2.time - INTERVAL '5' SECOND AND t2.time + INTERVAL '5' SECOND).
Temporal JoinJoins a stream against a versioned table/changelog source.
Event Time Temporal JoinSupported (FOR ... AS OF)Supported (Implicit / TEMPORAL JOIN)Flink requires explicit syntax. RisingWave support depends on the source type and query structure.
Processing Time Temporal JoinSupported (FOR ... AS OF)Supported (Lookup Joins)Flink requires explicit syntax. RisingWave typically achieves this using lookup joins against external tables.
Window JoinSupportedSupportedJoins aggregated results from windows.
Lookup JoinSupportedSupportedJoins a stream against an external dimension table (often async).

Set operations

Both support standard SQL set operations to combine or compare result sets.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
UNIONSupportedSupportedCombines results, removes duplicates.
UNION ALLSupportedSupportedCombines results, keeps duplicates.
INTERSECTSupportedSupportedReturns common rows, removes duplicates.
INTERSECT ALLSupportedNot SupportedReturns common rows, keeps duplicates.
EXCEPTSupportedSupportedReturns unique rows from first set not in second.
EXCEPT ALLSupportedNot SupportedReturns rows from first set not in second, keeps duplicates.
IN (Subquery)SupportedSupportedChecks for membership in a subquery result.
EXISTS (Subquery)SupportedSupportedChecks if a subquery returns any rows.
CORRESPONDINGNot SupportedSupportedPerforms set ops on specified columns by name (RisingWave-specific).

DDL statements (Data Definition Language)

As a streaming database, RisingWave has a broader set of Data Definition Language (DDL) commands, especially for managing sources, sinks, users, and connections.

Common DDL

OperationFlink (v1.20)RisingWave (v2.0)Notes
CREATE/DROP DATABASESupportedSupportedLogical grouping of objects.
CREATE/DROP VIEWSupportedSupportedDefines a logical view based on a query.
CREATE/DROP FUNCTIONSupportedSupportedDefines user-defined functions.
CREATE/DROP TABLESupportedSupportedFlink: Defines the schema and connector for a stream or table. RisingWave: Defines the schema for a source or internal table.
CREATE MATERIALIZED VIEWSupportedSupportedDefines a query whose results are stored. This is a core concept in RisingWave.
DROP MATERIALIZED VIEWSupportedSupportedRemoves a materialized view.
ALTER DATABASE/VIEW/FUNCTIONSupportedSupportedModifies existing objects (scope varies).

RisingWave-specific DDL

RisingWave includes the following DDL commands to manage its database-specific entities:

  • CREATE/DROP/ALTER SOURCE: Define connections to external data sources (e.g., Kafka, Kinesis).
  • CREATE/DROP/ALTER SINK: Define destinations for outputting data.
  • CREATE/DROP/ALTER CONNECTION: Reusable connection configurations for sources/sinks.
  • CREATE/DROP/ALTER SCHEMA: Organize objects within a database.
  • CREATE/DROP/ALTER USER: Manage database users.
  • CREATE/DROP SECRET: Securely store credentials.
  • CREATE/DROP/ALTER INDEX: Create indexes on materialized views/tables for faster lookups.
  • CREATE/DROP AGGREGATE: Define custom aggregate functions.
  • ALTER SYSTEM SET: Modify system-level configuration parameters.
  • CREATE OR REPLACE TABLE: Flink supports this atomic replacement syntax.
  • ALTER TABLE: Flink’s ALTER TABLE often has more capabilities for schema evolution depending on the connector and format, compared to RisingWave’s more restricted alteration of stateful sources/MVs. RW ALTER TABLE mainly supports renaming.

DML statements (Data Manipulation Language)

Data Manipulation Language (DML) statements interact with data in tables or trigger updates to materialized views.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
INSERT INTO ... SELECT ...SupportedSupportedInserts data from a query result. Triggers MV updates.
INSERT INTO ... VALUES ...SupportedSupportedInserts explicit rows. Triggers MV updates.
UPDATE ... SET ... WHERE ...SupportedSupportedUpdates existing rows based on conditions. Triggers MV updates.
DELETE FROM ... WHERE ...SupportedSupportedDeletes rows based on conditions. Triggers MV updates.
Multi-table INSERTSupportedNot SupportedFlink can insert into multiple tables from a single source query.
FLUSHNot SupportedSupportedRisingWave-specific: Ensures visibility of preceding DML changes in subsequent queries within a session (mainly for sinks).

Introspection and utility statements

Commands for exploring metadata, explaining queries, and managing sessions.

Common statements

  • SHOW DATABASES | TABLES | VIEWS | FUNCTIONS | JOBS: List common objects or entities (supported by both).
  • DESCRIBE <object>: Shows object metadata (e.g., columns, types). In Flink, <object> can be a table, view, or catalog. In RisingWave, <object> can be a table, source, view, sink, or materialized view.
  • EXPLAIN [statement]: Shows the logical and physical execution plan for a query.
  • USE [database/catalog]: Sets the current context for queries.
  • SET [key = value]: Modifies session configuration settings.

RisingWave-specific SHOW commands

Reflecting its database architecture, RisingWave offers additional SHOW commands for system introspection:

  • SHOW CLUSTER, SHOW PROCESSLIST, SHOW PARAMETERS
  • SHOW CONNECTIONS, SHOW SOURCES, SHOW SINKS, SHOW SCHEMAS
  • SHOW INDEX, SHOW MATERIALIZED VIEWS, SHOW INTERNAL TABLES
  • SHOW CREATE ... for various RW objects (Sources, Sinks, MVs, etc.)
  • SHOW CURSORS, SHOW SUBSCRIPTION CURSORS
  • SHOW JARS: Lists user-uploaded JAR files (relevant for Java UDFs).
  • SHOW PARTITIONS: Shows partitions for partitioned tables (common in batch/Hive integration).
  • SHOW CURRENT DATABASE: Flink command. RW uses SELECT current_database().

Flink requires managing JAR files containing UDFs or connectors.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
ADD JARSupportedNot SupportedAdds a JAR to the SQL classpath.
SHOW JARSSupportedNot SupportedLists added JAR files.
REMOVE JARSupportedNot SupportedRemoves a JAR (often session-specific).

Job management

Both systems allow managing running streaming queries/jobs.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
SHOW JOBSSupportedSupportedLists active streaming jobs/pipelines.
CANCEL JOB [id]SupportedSupportedStops a specific running job/pipeline.

Materialized views

While both support the concept, their role differs significantly.

  • RisingWave: Materialized Views are a core architectural concept. Queries are typically defined as MVs, which RisingWave keeps incrementally updated and stores efficiently. State management is built around MVs.
  • Flink: Materialized Views (or Materialized Tables) are an optional feature (experimental/evolving in 1.20). Flink can materialize query results using specific connectors, but it’s not the default way queries are executed or state is managed.

Access control (RisingWave-specific)

As a database system, RisingWave provides standard SQL access control.

FeatureFlink (v1.20)RisingWave (v2.0)Notes
GRANTNot SupportedSupportedGrants privileges on objects.
REVOKENot SupportedSupportedRevokes privileges from users.

Flink typically relies on external systems (like cluster managers or catalog providers) for access control.

User-defined Functions (UDFs)

Both systems allow you to extend SQL with custom logic using User-defined Functions (UDFs).

  • Supported Languages:
    • Flink (1.20): Java, Scala, and Python (primarily via an external Remote Procedure Call (RPC) mechanism).
    • RisingWave (2.0): SQL, Python, Java (via Java Native Interface (JNI)), JavaScript, and Rust (the latter via embedded WebAssembly (WASM) or Foreign Function Interface (FFI)).
  • Execution Models:
    • Flink: Embedded JVM functions (Java/Scala), External RPC functions (Python).
    • RisingWave: Embedded SQL functions, Embedded language functions via WASM/FFI/JNI.
  • Function Types: Both support Scalar Functions (UDF), Aggregate Functions (UDAF), and Table Functions (UDTF), although the specific implementation details and language support for each type can vary.
  • SQL UDFs: RisingWave allows you to define simple scalar functions directly using SQL expressions; Flink does not offer this capability.

Summary: Both offer extensibility, but RisingWave provides native SQL UDFs and uses WASM/FFI for several embedded languages, while Flink primarily uses JVM languages and an RPC mechanism for Python.

Built-in functions

Both Flink and RisingWave provide a rich library of built-in functions covering standard SQL categories. Listing every function is impractical here; instead, we highlight general coverage and key differences.

  • Common Coverage: Both systems offer extensive support for:

    • Comparison operators (=, >, <, etc.) and predicates (IS NULL, BETWEEN).
    • Logical operators (AND, OR, NOT).
    • Standard arithmetic operators (+, -, *, /, %) and functions (POWER, SQRT, ABS, ROUND, CEIL, FLOOR).
    • Common string manipulation functions (CONCAT, SUBSTRING, UPPER, LOWER, TRIM, REPLACE, LENGTH, POSITION, LIKE).
    • Basic temporal functions (EXTRACT, DATE_FORMAT/TO_CHAR, casting between date/time types).
    • Standard aggregate functions (COUNT, SUM, AVG, MAX, MIN, ARRAY_AGG, STRING_AGG).
    • Conditional expressions (CASE WHEN ... END, COALESCE, NULLIF).
    • Type casting (CAST).
    • Basic Array and Map functions/operators.
    • Set returning functions like generate_series.
  • Key Differences & Specific Functions:

    • Flink Specific:
      • URL parsing: PARSE_URL function.
      • Safe Casting: TRY_CAST (returns NULL on failure instead of error).
      • More extensive built-in time functions: LOCALTIME, CURRENT_TIME, etc.
      • Potentially more advanced collection functions (e.g., ARRAY_TRANSFORM).
      • Specific functions related to MATCH_RECOGNIZE.
    • RisingWave Specific:
      • Native JSONB operators (->, ->>, #>, etc.) and functions.
      • PostgreSQL compatibility functions (e.g., pg_typeof, pg_sleep).
      • Encryption functions: encrypt(), decrypt().
      • TIMESTAMPTZ handling functions.
      • Uses standard CAST which errors on failure in queries (but NULLs in MVs).

Recommendation: Always consult the official Flink SQL and RisingWave SQL documentation for the most current and comprehensive list of supported built-in functions.

System management & information

  • RisingWave: Provides SQL functions and SHOW commands specifically designed for managing and monitoring the streaming database system itself, providing information such as cluster status, internal tables, process lists, and system parameters.
  • Flink: Relies on its framework APIs, metrics system, and external tools (like its Web UI or platform integrations) for system management and monitoring, rather than using built-in SQL functions for these tasks.

Other features

FeatureFlink (v1.20)RisingWave (v2.0)Notes
CatalogsSupportedSupportedManage metadata namespaces (e.g., connecting to external catalogs).
SQL ClientSupportedSupportedInteractive command-line interface for SQL execution.
SQL GatewaySupportedSupportedService for accepting remote SQL submissions (e.g., via REST/JDBC).
Hive CompatibilitySupportedNot SupportedFlink has strong integration with Apache Hive (catalog, formats).

Conclusion

RisingWave and Flink SQL, while both powerful stream processing tools, cater to slightly different needs and design philosophies, which are reflected in their SQL dialects and features.

  • Flink SQL (1.20) is a flexible processing framework with strong Hive integration, MATCH_RECOGNIZE for CEP, and specific features like TRY_CAST and JAR management.
  • RisingWave SQL (2.0) offers a PostgreSQL-compatible experience tailored for a streaming database, featuring core materialized views, native JSONB, built-in sources/sinks management, access control, and unique DDL/system management capabilities.

Your choice between them depends on whether you need a standalone streaming database solution (RisingWave) or a flexible stream processing framework that integrates with diverse ecosystems (Flink).