Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public class SchemaValidation {
ArrayType.class,
RowType.class,
MultisetType.class,
VectorType.class);
VectorType.class,
VariantType.class);

/**
* Validate the {@link TableSchema} and {@link CoreOptions}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.paimon.types.MapType;
import org.apache.paimon.types.RowType;
import org.apache.paimon.types.VarCharType;
import org.apache.paimon.types.VariantType;
import org.apache.paimon.utils.ChangelogManager;
import org.apache.paimon.utils.FailingFileIO;
import org.apache.paimon.utils.SnapshotManager;
Expand Down Expand Up @@ -588,6 +589,33 @@ public void testPartitionType() {
MapType.class.getSimpleName(), "f0");
}

@Test
public void testVariantKeyType() {
final RowType variantType =
RowType.of(new VariantType(), new BigIntType(), new VarCharType());

final Schema variantPrimaryKeySchema =
new Schema(variantType.getFields(), partitionKeys, primaryKeys, options, "");
assertThatThrownBy(() -> manager.createTable(variantPrimaryKeySchema))
.isInstanceOf(UnsupportedOperationException.class)
.hasMessage(
"The type %s in primary key field %s is unsupported",
VariantType.class.getSimpleName(), "f0");

final Schema variantPartitionSchema =
new Schema(
variantType.getFields(),
partitionKeys,
Collections.emptyList(),
options,
"");
assertThatThrownBy(() -> manager.createTable(variantPartitionSchema))
.isInstanceOf(UnsupportedOperationException.class)
.hasMessage(
"The type %s in partition field %s is unsupported",
VariantType.class.getSimpleName(), "f0");
}

@Test
public void testChangelogTableWithFullCompaction() throws Exception {
Map<String, String> options = new HashMap<>();
Expand Down
Loading