CREATE … CLONE command: Cloning databases and schemas that contain hybrid tables

Attention

This behavior change is in the 2024_08 bundle.

For the current status of the bundle, refer to Bundle History.

Given that hybrid tables have limited support for cloning, note the following behavior when you attempt to clone a database or a schema that contains hybrid tables:

Before the change:

In general, CREATE DATABASE … CLONE and CREATE SCHEMA … CLONE commands silently skip hybrid tables if any exist in the specified database or schema.

CREATE DATABASE … CLONE commands do clone hybrid tables if no Time Travel parameters are specified in the command, or if an AT TIMESTAMP value is specified.

For example, the following commands succeed but skip hybrid tables:

CREATE SCHEMA dst CLONE src;
CREATE DATABASE dst CLONE src
  BEFORE (STATEMENT => '01b7676a-0002-d908-0000-a99500f6e00e');
Copy

The following command succeeds and includes hybrid tables in the cloned database:

CREATE DATABASE dst CLONE src;
Copy
After the change:

CREATE SCHEMA … CLONE commands return an error if any hybrid tables exist in the specified schema. For example, the following command fails:

CREATE SCHEMA dst CLONE src;
Copy
392105 (0A000): SQL execution error: Cloning a SCHEMA which contains a HYBRID TABLE is unsupported. To perform the clone while skipping HYBRID TABLES, append the `IGNORE HYBRID TABLES` syntax to your DDL.

The error prompts you to run the command using the IGNORE HYBRID TABLES parameter. When you use this parameter, the command will create the cloned schema but skip any hybrid tables. For example:

CREATE SCHEMA dst CLONE src IGNORE HYBRID TABLES;
Copy

The behavior of CREATE DATABASE … CLONE commands that do not specify Time Travel parameters does not change. For example, the following command succeeds and includes hybrid tables in the cloned database:

CREATE DATABASE dst CLONE src;
Copy

CREATE DATABASE … CLONE commands that use Time Travel and specify the time with the STATEMENT parameter return an error if any hybrid tables exist in the specified database. For example, the following command fails:

CREATE DATABASE dst CLONE src
  BEFORE (STATEMENT => '01b7676a-0002-d908-0000-a99500f6e00e');
Copy
392106 (0A000): SQL execution error: Time Travel cloning a DATABASE which contains a HYBRID TABLE, when specifying the time via a `STATEMENT` is unsupported. To perform the clone while skipping HYBRID TABLES, append the `IGNORE HYBRID TABLES` syntax to your DDL.

The error prompts you to run the command using the IGNORE HYBRID TABLES parameter. When you use this parameter, the command will create the cloned database but skip any hybrid tables. For example:

CREATE DATABASE dst CLONE src
  BEFORE (STATEMENT => '01b7676a-0002-d908-0000-a99500f6e00e')
  IGNORE HYBRID TABLES;
Copy

Other CREATE DATABASE … CLONE commands that specify Time Travel parameters and do not use AT TIMESTAMP on a target database that contains hybrid tables either return an error or silently skip the hybrid tables:

  • If the bundle is enabled (either explicitly or by default), these CREATE DATABASE … CLONE commands return an error.

  • If the bundle is explicitly disabled, these CREATE DATABASE … CLONE commands silently skip hybrid tables.

For more information, see Clone databases that contain hybrid tables.

Ref: 1792