Highlights of RisingWave v1.5: The Open-Source Streaming Database
Tags: news, database, productivity, opensource
Published: 2023-12-26 14:00:00

> [**Emily Le**](https://github.com/emile-00) **｜Developer Advocate**

With the launch of [RisingWave](https://risingwave.com/blog/highlights-of-risingwave-v1-5-the-open-source-streaming-database/) v1.5, the RisingWave team once again introduces remarkable features and updates. This release focuses on extending the capabilities of existing SQL commands and introducing new functions. Follow along as we showcase some of the standout features.

If you are interested in the full list of v1.5 updates, see the [release note](https://docs.risingwave.com/release-notes/).

## Major updates to `ALTER` commands

This month brings in a myriad of new `ALTER` commands, allowing you to make changes to objects in your database as well as the database itself. With it, also comes new clauses that you can include with the commands. Let us briefly go over these new, exciting updates.

### New `ALTER` commands

Previously, you could only alter sources, tables, and users. Now the `ALTER` command also applies to connections, databases, functions, materialized views, schemas, and views, offering you much more control over your databases and database objects. For instance, the following SQL query changes the user and schema of the materialized view `mv1` .

```
ALTER MATERIALIZED VIEW mv1
OWNER TO new_user;

ALTER MATERIALIZED VIEW mv1
SET SCHEMA schema2;
```

### New clauses

Three new clauses are also introduced with this update. They include:

-   `SET SCHEMA` clause This clause allows you to move the database object into a different schema. Any dependent objects are moved as well, if applicable. The `SET SCHEMA` clause can be used when altering connections, functions, materialized views, sinks, sources, tables, and views.
-   `OWNER TO` clause This clause changes the owner of the specified database object. You can use this clause when applying the `ALTER` command to databases, materialized views, schemas, sinks, sources, tables, and views.
-   `RENAME TO` clause The `RENAME TO` clause allows you to change the name of the specified object. This clause can be applied when altering users, connections, databases, functions, materialized views, schemas, sinks, and views.

These new updates offer you more flexibility and adaptability to meet the changing needs of a streaming database.

For more details:

-   see the [SQL commands](https://docs.risingwave.com/docs/current/sql-commands/).

## Support for `SHOW PROCESSLIST` and `KILL`

To assist you with monitoring the health of the database, we now support the `SHOW PROCESSLIST` command, which displays the session’s current workload. It provides a list of statements that are currently being executed by the system. Here is an example of what you might see. The output table shows the ID, user, host, database, elapsed time, and statement associated with the processes.

```
SHOW PROCESSLIST;
------RESULT
 Id | User |      Host       | Database | Time |                 Info
----+------+-----------------+----------+------+---------------------------------------
 56 | root | 127.0.0.1:57542 | dev      | 6ms  | SELECT c FROM sbtest1 WHERE id=197719
```

If there is an issue with one of the running queries, you can use the `KILL` command to stop the process by specifying the ID.

```
dev=> KILL 56;
KILL
```

The combination of these two commands offers you the ability to diagnose and fix performance issues affecting your session.

For more details:

-   see the `[SHOW PROCESSLIST` [command](https://docs.risingwave.com/docs/current/sql-show-processlist/))].

## New JSON functions

We are excited to unveil more new JSON functions this month! Let us go over some of these functions.

### JSONPath functions

This update introduces a set of JSON functions that accept JSONPath expressions as input. JSONPath is a query language that extracts data from JSON data. In RisingWave, JSONPath expressions are parsed as `varchar` types and not `jsonpath` types, but this does not affect the usage of the functions.

The new JSONPath functions and operators introduced include: `@?`, `@@`, `jsonb_path_exists`, `jsonb_path_match`, `jsonb_path_query`, `jsonb_path_query_array`, and `jsonb_path_query_first`. Here is an example of `jsonb_path_exists`, which checks if the JSONPath expression returns any item from the given JSON value.

```
jsonb_path_exists('[{"a": 1}, {"a": 2}, 3]', 'lax $[*].a', '{}') → t
```

### JSON build functions

The `jsonb_build_array` and `jsonb_build_object` functions are also included in this update. These functions build a JSON array and object, respectively, given a variadic argument list. Here is an example of `jsonb_build_object`.

```
jsonb_build_object('foo', 1, 2, row(3,'bar')) → {"foo" : 1, "2" : {"f1":3,"f2":"bar"}}
```

The list of input arguments consists of alternating keys and values, so `foo` and `2` become keys. The keys are converted to text while values are converted as per `to_jsonb`.

For more details:

-   See [JSON functions and operators](https://docs.risingwave.com/docs/current/sql-function-json/).

## Create multiple CDC tables with the same MySQL source

We now have an updated and more convenient method to create multiple CDC tables using the same MySQL source. Previously, if you wanted to ingest CDC data from different tables in the same database, you would call the `CREATE TABLE` command and specify the database credentials multiple times. This process has been simplified with this version update.

Now you can use the `CREATE SOURCE` command to establish a connection with the desired database and then use the `CREATE TABLE` function to ingest data from individual tables within the database. This means that the database credentials only need to be specified once when establishing the connection, streamlining the process. Furthermore, this feature supports incremental and lock-free snapshot loading.

For more details:

-   See [Create multiple CDC tables with the same source](https://docs.risingwave.com/docs/current/ingest-from-mysql-cdc/#create-multiple-cdc-tables-with-the-same-source).

> **CONLUSION**

These are just some of the new features included with the release of RisingWave v1.5. To see the entire list of updates, please refer to the detailed [release notes](https://docs.risingwave.com/release-notes/).

> **About RisingWave Labs**

[RisingWave](https://risingwave.com/) is an open-source distributed SQL database for stream processing. It is designed to reduce the complexity and cost of building real-time applications. RisingWave offers users a PostgreSQL-like experience specifically tailored for distributed stream processing.