From bf6e13c0d0006e3eabf3d914cc90d5d1dfa4f007 Mon Sep 17 00:00:00 2001 From: illia-li Date: Fri, 7 Jul 2023 13:09:40 -0400 Subject: [PATCH] add(typedef) add marshal and unmarshal test for full cases schema --- cmd/gemini/root.go | 14 - cmd/gemini/schema.go | 3 +- cmd/gemini/strategies_test.go | 3 +- pkg/replication/replication.go | 17 + pkg/tableopts/options.go | 14 + pkg/typedef/schema_test.go | 310 ++++++++ .../test_expected_data/full_schema.json | 668 ++++++++++++++++++ 7 files changed, 1013 insertions(+), 16 deletions(-) create mode 100644 pkg/typedef/test_expected_data/full_schema.json diff --git a/cmd/gemini/root.go b/cmd/gemini/root.go index 5508e00f..90d2fb08 100644 --- a/cmd/gemini/root.go +++ b/cmd/gemini/root.go @@ -33,7 +33,6 @@ import ( "github.com/scylladb/gemini/pkg/jobs" "github.com/scylladb/gemini/pkg/replication" "github.com/scylladb/gemini/pkg/store" - "github.com/scylladb/gemini/pkg/tableopts" "github.com/scylladb/gemini/pkg/typedef" "github.com/scylladb/gemini/pkg/utils" @@ -392,19 +391,6 @@ func createClusters( return testCluster, oracleCluster } -func createTableOptions(tableOptionStrings []string, logger *zap.Logger) []tableopts.Option { - var tableOptions []tableopts.Option - for _, optionString := range tableOptionStrings { - o, err := tableopts.FromCQL(optionString) - if err != nil { - logger.Warn("invalid table option", zap.String("option", optionString), zap.Error(err)) - continue - } - tableOptions = append(tableOptions, o) - } - return tableOptions -} - func getReplicationStrategy(rs string, fallback *replication.Replication, logger *zap.Logger) *replication.Replication { switch rs { case "network": diff --git a/cmd/gemini/schema.go b/cmd/gemini/schema.go index 58d8a6d0..09cb6b48 100644 --- a/cmd/gemini/schema.go +++ b/cmd/gemini/schema.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/scylladb/gemini/pkg/replication" + "github.com/scylladb/gemini/pkg/tableopts" "github.com/scylladb/gemini/pkg/typedef" "go.uber.org/zap" @@ -67,7 +68,7 @@ func createDefaultSchemaConfig(logger *zap.Logger) typedef.SchemaConfig { return typedef.SchemaConfig{ ReplicationStrategy: rs, OracleReplicationStrategy: ors, - TableOptions: createTableOptions(tableOptions, logger), + TableOptions: tableopts.CreateTableOptions(tableOptions, logger), MaxTables: maxTables, MaxPartitionKeys: maxPartitionKeys, MinPartitionKeys: minPartitionKeys, diff --git a/cmd/gemini/strategies_test.go b/cmd/gemini/strategies_test.go index ad25ef4f..6859024e 100644 --- a/cmd/gemini/strategies_test.go +++ b/cmd/gemini/strategies_test.go @@ -60,7 +60,8 @@ func TestGetReplicationStrategy(t *testing.T) { } } -func TestReadSchema(t *testing.T) { +// TestReadExampleSchema main task of this test to be sure that schema example (schema.json) is correct and have correct marshal, unmarshal +func TestReadExampleSchema(t *testing.T) { filePath := "schema.json" testSchema, err := readSchema(filePath, typedef.SchemaConfig{}) diff --git a/pkg/replication/replication.go b/pkg/replication/replication.go index ab143e3b..8bd80d66 100644 --- a/pkg/replication/replication.go +++ b/pkg/replication/replication.go @@ -39,3 +39,20 @@ func NewNetworkTopologyStrategy() *Replication { "datacenter1": 1, } } + +func (r *Replication) UnmarshalJSON(data []byte) error { + dataMap := make(map[string]interface{}) + if err := json.Unmarshal(data, &dataMap); err != nil { + return err + } + out := Replication{} + for idx := range dataMap { + val := dataMap[idx] + if fVal, ok := val.(float64); ok { + dataMap[idx] = int(fVal) + } + out[idx] = dataMap[idx] + } + *r = out + return nil +} diff --git a/pkg/tableopts/options.go b/pkg/tableopts/options.go index db3c8927..7b02cedc 100644 --- a/pkg/tableopts/options.go +++ b/pkg/tableopts/options.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/pkg/errors" + "go.uber.org/zap" ) type Option interface { @@ -65,3 +66,16 @@ func FromCQL(cql string) (Option, error) { val: valPart, }, nil } + +func CreateTableOptions(tableOptionStrings []string, logger *zap.Logger) []Option { + var tableOptions []Option + for _, optionString := range tableOptionStrings { + o, err := FromCQL(optionString) + if err != nil { + logger.Warn("invalid table option", zap.String("option", optionString), zap.Error(err)) + continue + } + tableOptions = append(tableOptions, o) + } + return tableOptions +} diff --git a/pkg/typedef/schema_test.go b/pkg/typedef/schema_test.go index 2da47816..64b149e0 100644 --- a/pkg/typedef/schema_test.go +++ b/pkg/typedef/schema_test.go @@ -16,9 +16,15 @@ package typedef import ( + "encoding/json" + "os" "testing" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + + "github.com/scylladb/gemini/pkg/replication" + "github.com/scylladb/gemini/pkg/tableopts" ) func TestSchemaConfigValidate(t *testing.T) { @@ -100,3 +106,307 @@ func TestSchemaConfigValidate(t *testing.T) { }) } } + +// TestSchemaMarshalUnmarshalNotChanged main task of this test catch all possible changes in json representation of schema and notify QA about this. +// +// If any change was catch and if you sure that this changes really needed - you should notify QA about this changes by create new issue https://github.com/scylladb/scylla-cluster-tests/issues/new +// Only then you can rewrite expected data file +func TestSchemaMarshalUnmarshalNotChanged(t *testing.T) { + expectedFilePath := "./test_expected_data/full_schema.json" + + fullSchemaExpected, err := os.ReadFile(expectedFilePath) + if err != nil { + t.Fatalf("failed to open schema json file %s, error:%s", expectedFilePath, err) + } + + fullSchemaMarshaled, err := json.MarshalIndent(fullSchema, "", " ") + if err != nil { + t.Fatalf("unable to marshal schema json, error=%s\n", err) + } + + if diff := cmp.Diff(fullSchemaExpected, fullSchemaMarshaled); diff != "" { + t.Errorf("schema not the same after marshal, diff=%s", diff) + t.Error("if you sure that this changes really needed - you should notify QA about this changes by create new issue https://github.com/scylladb/scylla-cluster-tests/issues/new\n" + + "Only then you can rewrite expected data file") + } + + fullSchemaExpectedUnmarshalled := Schema{} + + if err = json.Unmarshal(fullSchemaExpected, &fullSchemaExpectedUnmarshalled); err != nil { + t.Fatalf("unable to marshal schema example json, error=%s\n", err) + } + + opts := cmp.Options{ + cmp.AllowUnexported(Table{}, MaterializedView{}), + cmpopts.IgnoreUnexported(Table{}, MaterializedView{}), + cmpopts.EquateEmpty(), + } + + fullSchema.Config = SchemaConfig{} + if diff := cmp.Diff(fullSchema, fullSchemaExpectedUnmarshalled, opts); diff != "" { + t.Errorf("schema not the same after unmarshal, diff=%s", diff) + t.Error("if you sure that this changes really needed - you should notify QA about this changes by create new issue https://github.com/scylladb/scylla-cluster-tests/issues/new\n" + + "Only then you can rewrite expected data file") + } +} + +// nolint: revive +var fullSchema = Schema{ + Keyspace: Keyspace{ + Replication: replication.NewSimpleStrategy(), + OracleReplication: replication.NewSimpleStrategy(), + Name: "ks1", + }, + Tables: []*Table{ + { + Name: "tb0", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_ASCII}, + {Name: "pk1", Type: TYPE_BIGINT}, + {Name: "pk2", Type: TYPE_BLOB}, + {Name: "pk3", Type: TYPE_BOOLEAN}, + {Name: "pk4", Type: TYPE_DATE}, + {Name: "pk5", Type: TYPE_DECIMAL}, + {Name: "pk6", Type: TYPE_DOUBLE}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_FLOAT}, + {Name: "ck1", Type: TYPE_INET}, + {Name: "ck2", Type: TYPE_INT}, + {Name: "ck3", Type: TYPE_SMALLINT}, + {Name: "ck4", Type: TYPE_TEXT}, + {Name: "ck5", Type: TYPE_TIMESTAMP}, + {Name: "ck6", Type: TYPE_TIMEUUID}, + }, + Columns: Columns{ + {Name: "col0", Type: TYPE_ASCII}, + {Name: "col1", Type: TYPE_BIGINT}, + {Name: "col2", Type: TYPE_BLOB}, + {Name: "col3", Type: TYPE_BOOLEAN}, + {Name: "col4", Type: TYPE_DATE}, + {Name: "col5", Type: TYPE_DECIMAL}, + {Name: "col6", Type: TYPE_DOUBLE}, + {Name: "col7", Type: TYPE_FLOAT}, + {Name: "col8", Type: TYPE_INET}, + {Name: "col9", Type: TYPE_INT}, + {Name: "col10", Type: TYPE_SMALLINT}, + {Name: "col11", Type: TYPE_TEXT}, + {Name: "col12", Type: TYPE_TIMESTAMP}, + {Name: "col13", Type: TYPE_TIMEUUID}, + {Name: "col14", Type: TYPE_TINYINT}, + {Name: "col15", Type: TYPE_UUID}, + {Name: "col16", Type: TYPE_VARCHAR}, + {Name: "col17", Type: TYPE_VARINT}, + {Name: "col18", Type: TYPE_TIME}, + {Name: "col19", Type: TYPE_DURATION}, + }, + Indexes: []IndexDef{ + {IndexName: "col0_idx", ColumnName: "col0"}, + {IndexName: "col12_idx", ColumnName: "col12"}, + }, + MaterializedViews: nil, + KnownIssues: map[string]bool{KnownIssuesJSONWithTuples: true}, + TableOptions: []string{"compression = {'sstable_compression':'LZ4Compressor'}", "read_repair_chance = 1.0", "comment = 'Important records'", "cdc = {'enabled':'true','preimage':'true'}", "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}"}, + }, { + Name: "tb1", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_FLOAT}, + {Name: "pk1", Type: TYPE_INET}, + {Name: "pk2", Type: TYPE_INT}, + {Name: "pk3", Type: TYPE_SMALLINT}, + {Name: "pk4", Type: TYPE_TEXT}, + {Name: "pk5", Type: TYPE_TIMESTAMP}, + {Name: "pk6", Type: TYPE_TIMEUUID}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_ASCII}, + {Name: "ck1", Type: TYPE_BIGINT}, + {Name: "ck2", Type: TYPE_BLOB}, + {Name: "ck3", Type: TYPE_BOOLEAN}, + {Name: "ck4", Type: TYPE_DATE}, + {Name: "ck5", Type: TYPE_DECIMAL}, + {Name: "ck6", Type: TYPE_DOUBLE}, + }, + Columns: Columns{ + {Name: "col0", Type: TYPE_ASCII}, + {Name: "col1", Type: TYPE_BIGINT}, + {Name: "col2", Type: TYPE_BLOB}, + {Name: "col3", Type: TYPE_BOOLEAN}, + {Name: "col4", Type: TYPE_DATE}, + {Name: "col5", Type: TYPE_DECIMAL}, + {Name: "col6", Type: TYPE_DOUBLE}, + {Name: "col7", Type: TYPE_FLOAT}, + {Name: "col8", Type: TYPE_INET}, + {Name: "col9", Type: TYPE_INT}, + {Name: "col10", Type: TYPE_SMALLINT}, + {Name: "col11", Type: TYPE_TEXT}, + {Name: "col12", Type: TYPE_TIMESTAMP}, + {Name: "col13", Type: TYPE_TIMEUUID}, + {Name: "col14", Type: TYPE_TINYINT}, + {Name: "col15", Type: TYPE_UUID}, + {Name: "col16", Type: TYPE_VARCHAR}, + {Name: "col17", Type: TYPE_VARINT}, + {Name: "col18", Type: TYPE_TIME}, + {Name: "col19", Type: TYPE_DURATION}, + }, + Indexes: []IndexDef{ + {IndexName: "col0_idx", ColumnName: "col0"}, + {IndexName: "col12_idx", ColumnName: "col12"}, + }, + MaterializedViews: []MaterializedView{ + { + NonPrimaryKey: &ColumnDef{ + Type: TYPE_DECIMAL, + Name: "col5", + }, + Name: "mv0", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_FLOAT}, + {Name: "pk1", Type: TYPE_INET}, + {Name: "pk2", Type: TYPE_INT}, + {Name: "pk3", Type: TYPE_SMALLINT}, + {Name: "pk4", Type: TYPE_TEXT}, + {Name: "pk5", Type: TYPE_TIMESTAMP}, + {Name: "pk6", Type: TYPE_TIMEUUID}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_ASCII}, + {Name: "ck1", Type: TYPE_BIGINT}, + {Name: "ck2", Type: TYPE_BLOB}, + {Name: "ck3", Type: TYPE_BOOLEAN}, + {Name: "ck4", Type: TYPE_DATE}, + {Name: "ck5", Type: TYPE_DECIMAL}, + {Name: "ck6", Type: TYPE_DOUBLE}, + }, + }, { + NonPrimaryKey: &ColumnDef{ + Type: TYPE_ASCII, + Name: "col0_idx", + }, + Name: "mv1", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_FLOAT}, + {Name: "pk1", Type: TYPE_INET}, + {Name: "pk2", Type: TYPE_INT}, + {Name: "pk3", Type: TYPE_SMALLINT}, + {Name: "pk4", Type: TYPE_TEXT}, + {Name: "pk5", Type: TYPE_TIMESTAMP}, + {Name: "pk6", Type: TYPE_TIMEUUID}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_ASCII}, + {Name: "ck1", Type: TYPE_BIGINT}, + {Name: "ck2", Type: TYPE_BLOB}, + {Name: "ck3", Type: TYPE_BOOLEAN}, + {Name: "ck4", Type: TYPE_DATE}, + {Name: "ck5", Type: TYPE_DECIMAL}, + {Name: "ck6", Type: TYPE_DOUBLE}, + }, + }, + }, + KnownIssues: map[string]bool{KnownIssuesJSONWithTuples: true}, + TableOptions: []string{"compression = {'sstable_compression':'LZ4Compressor'}", "read_repair_chance = 1.0", "comment = 'Important records'", "cdc = {'enabled':'true','preimage':'true'}", "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}"}, + }, { + Name: "tb2", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_TINYINT}, + {Name: "pk1", Type: TYPE_UUID}, + {Name: "pk2", Type: TYPE_VARCHAR}, + {Name: "pk3", Type: TYPE_VARINT}, + {Name: "pk4", Type: TYPE_TIME}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_TINYINT}, + {Name: "ck1", Type: TYPE_UUID}, + {Name: "ck2", Type: TYPE_VARCHAR}, + {Name: "ck3", Type: TYPE_VARINT}, + {Name: "ck4", Type: TYPE_TIME}, + {Name: "ck5", Type: TYPE_DURATION}, + }, + Columns: Columns{ + {Name: "col0", Type: &UDTType{ + ComplexType: "udt", + ValueTypes: map[string]SimpleType{"udt_10.1": TYPE_BIGINT, "udt_10.2": TYPE_DATE, "udt_10.3": TYPE_BLOB}, + TypeName: "udt_10", + Frozen: false, + }}, + {Name: "col1", Type: &MapType{ + ComplexType: "map", + KeyType: TYPE_INET, + ValueType: TYPE_TIME, + Frozen: true, + }}, + {Name: "col2", Type: &TupleType{ + ComplexType: "tuple", + ValueTypes: []SimpleType{TYPE_FLOAT, TYPE_DATE, TYPE_VARCHAR}, + Frozen: false, + }}, + {Name: "col3", Type: &BagType{ + ComplexType: "list", + ValueType: TYPE_UUID, + Frozen: true, + }}, + {Name: "col4", Type: &BagType{ + ComplexType: "set", + ValueType: TYPE_TIMESTAMP, + Frozen: false, + }}, + {Name: "col5", Type: TYPE_DECIMAL}, + }, + Indexes: []IndexDef{ + {IndexName: "col0_idx", ColumnName: "col0"}, + {IndexName: "col12_idx", ColumnName: "col12"}, + }, + MaterializedViews: []MaterializedView{ + { + NonPrimaryKey: nil, + Name: "mv0", + PartitionKeys: Columns{ + {Name: "pk0", Type: TYPE_TINYINT}, + {Name: "pk1", Type: TYPE_UUID}, + {Name: "pk2", Type: TYPE_VARCHAR}, + {Name: "pk3", Type: TYPE_VARINT}, + {Name: "pk4", Type: TYPE_TIME}, + }, + ClusteringKeys: Columns{ + {Name: "ck0", Type: TYPE_TINYINT}, + {Name: "ck1", Type: TYPE_UUID}, + {Name: "ck2", Type: TYPE_VARCHAR}, + {Name: "ck3", Type: TYPE_VARINT}, + {Name: "ck4", Type: TYPE_TIME}, + {Name: "ck5", Type: TYPE_DURATION}, + }, + }, + }, + KnownIssues: map[string]bool{KnownIssuesJSONWithTuples: true}, + TableOptions: []string{"compression = {'sstable_compression':'LZ4Compressor'}", "read_repair_chance = 1.0", "comment = 'Important records'", "cdc = {'enabled':'true','preimage':'true'}", "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}"}, + }, + }, + Config: SchemaConfig{ + ReplicationStrategy: replication.NewSimpleStrategy(), + OracleReplicationStrategy: replication.NewSimpleStrategy(), + TableOptions: tableopts.CreateTableOptions([]string{ + "compression = {'sstable_compression':'LZ4Compressor'}", + "read_repair_chance = 1.0", "comment = 'Important records'", "cdc = {'enabled':'true','preimage':'true'}", + "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}", + }, nil), + MaxTables: 10, + MaxPartitionKeys: 10, + MinPartitionKeys: 1, + MaxClusteringKeys: 10, + MinClusteringKeys: 1, + MaxColumns: 25, + MinColumns: 1, + MaxUDTParts: 20, + MaxTupleParts: 20, + MaxBlobLength: 1e4, + MaxStringLength: 1000, + MinBlobLength: 0, + MinStringLength: 0, + UseCounters: false, + UseLWT: false, + CQLFeature: CQL_FEATURE_NORMAL, + AsyncObjectStabilizationAttempts: 10, + AsyncObjectStabilizationDelay: 100000, + }, +} diff --git a/pkg/typedef/test_expected_data/full_schema.json b/pkg/typedef/test_expected_data/full_schema.json new file mode 100644 index 00000000..a30174d7 --- /dev/null +++ b/pkg/typedef/test_expected_data/full_schema.json @@ -0,0 +1,668 @@ +{ + "keyspace": { + "replication": { + "class": "SimpleStrategy", + "replication_factor": 1 + }, + "oracle_replication": { + "class": "SimpleStrategy", + "replication_factor": 1 + }, + "name": "ks1" + }, + "tables": [ + { + "name": "tb0", + "partition_keys": [ + { + "type": "ascii", + "name": "pk0" + }, + { + "type": "bigint", + "name": "pk1" + }, + { + "type": "blob", + "name": "pk2" + }, + { + "type": "boolean", + "name": "pk3" + }, + { + "type": "date", + "name": "pk4" + }, + { + "type": "decimal", + "name": "pk5" + }, + { + "type": "double", + "name": "pk6" + } + ], + "clustering_keys": [ + { + "type": "float", + "name": "ck0" + }, + { + "type": "inet", + "name": "ck1" + }, + { + "type": "int", + "name": "ck2" + }, + { + "type": "smallint", + "name": "ck3" + }, + { + "type": "text", + "name": "ck4" + }, + { + "type": "timestamp", + "name": "ck5" + }, + { + "type": "timeuuid", + "name": "ck6" + } + ], + "columns": [ + { + "type": "ascii", + "name": "col0" + }, + { + "type": "bigint", + "name": "col1" + }, + { + "type": "blob", + "name": "col2" + }, + { + "type": "boolean", + "name": "col3" + }, + { + "type": "date", + "name": "col4" + }, + { + "type": "decimal", + "name": "col5" + }, + { + "type": "double", + "name": "col6" + }, + { + "type": "float", + "name": "col7" + }, + { + "type": "inet", + "name": "col8" + }, + { + "type": "int", + "name": "col9" + }, + { + "type": "smallint", + "name": "col10" + }, + { + "type": "text", + "name": "col11" + }, + { + "type": "timestamp", + "name": "col12" + }, + { + "type": "timeuuid", + "name": "col13" + }, + { + "type": "tinyint", + "name": "col14" + }, + { + "type": "uuid", + "name": "col15" + }, + { + "type": "varchar", + "name": "col16" + }, + { + "type": "varint", + "name": "col17" + }, + { + "type": "time", + "name": "col18" + }, + { + "type": "duration", + "name": "col19" + } + ], + "indexes": [ + { + "Column": null, + "index_name": "col0_idx", + "column_name": "col0" + }, + { + "Column": null, + "index_name": "col12_idx", + "column_name": "col12" + } + ], + "known_issues": { + "https://github.com/scylladb/scylla/issues/3708": true + }, + "table_options": [ + "compression = {'sstable_compression':'LZ4Compressor'}", + "read_repair_chance = 1.0", + "comment = 'Important records'", + "cdc = {'enabled':'true','preimage':'true'}", + "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}" + ] + }, + { + "name": "tb1", + "partition_keys": [ + { + "type": "float", + "name": "pk0" + }, + { + "type": "inet", + "name": "pk1" + }, + { + "type": "int", + "name": "pk2" + }, + { + "type": "smallint", + "name": "pk3" + }, + { + "type": "text", + "name": "pk4" + }, + { + "type": "timestamp", + "name": "pk5" + }, + { + "type": "timeuuid", + "name": "pk6" + } + ], + "clustering_keys": [ + { + "type": "ascii", + "name": "ck0" + }, + { + "type": "bigint", + "name": "ck1" + }, + { + "type": "blob", + "name": "ck2" + }, + { + "type": "boolean", + "name": "ck3" + }, + { + "type": "date", + "name": "ck4" + }, + { + "type": "decimal", + "name": "ck5" + }, + { + "type": "double", + "name": "ck6" + } + ], + "columns": [ + { + "type": "ascii", + "name": "col0" + }, + { + "type": "bigint", + "name": "col1" + }, + { + "type": "blob", + "name": "col2" + }, + { + "type": "boolean", + "name": "col3" + }, + { + "type": "date", + "name": "col4" + }, + { + "type": "decimal", + "name": "col5" + }, + { + "type": "double", + "name": "col6" + }, + { + "type": "float", + "name": "col7" + }, + { + "type": "inet", + "name": "col8" + }, + { + "type": "int", + "name": "col9" + }, + { + "type": "smallint", + "name": "col10" + }, + { + "type": "text", + "name": "col11" + }, + { + "type": "timestamp", + "name": "col12" + }, + { + "type": "timeuuid", + "name": "col13" + }, + { + "type": "tinyint", + "name": "col14" + }, + { + "type": "uuid", + "name": "col15" + }, + { + "type": "varchar", + "name": "col16" + }, + { + "type": "varint", + "name": "col17" + }, + { + "type": "time", + "name": "col18" + }, + { + "type": "duration", + "name": "col19" + } + ], + "indexes": [ + { + "Column": null, + "index_name": "col0_idx", + "column_name": "col0" + }, + { + "Column": null, + "index_name": "col12_idx", + "column_name": "col12" + } + ], + "materialized_views": [ + { + "NonPrimaryKey": { + "type": "decimal", + "name": "col5" + }, + "name": "mv0", + "partition_keys": [ + { + "type": "float", + "name": "pk0" + }, + { + "type": "inet", + "name": "pk1" + }, + { + "type": "int", + "name": "pk2" + }, + { + "type": "smallint", + "name": "pk3" + }, + { + "type": "text", + "name": "pk4" + }, + { + "type": "timestamp", + "name": "pk5" + }, + { + "type": "timeuuid", + "name": "pk6" + } + ], + "clustering_keys": [ + { + "type": "ascii", + "name": "ck0" + }, + { + "type": "bigint", + "name": "ck1" + }, + { + "type": "blob", + "name": "ck2" + }, + { + "type": "boolean", + "name": "ck3" + }, + { + "type": "date", + "name": "ck4" + }, + { + "type": "decimal", + "name": "ck5" + }, + { + "type": "double", + "name": "ck6" + } + ] + }, + { + "NonPrimaryKey": { + "type": "ascii", + "name": "col0_idx" + }, + "name": "mv1", + "partition_keys": [ + { + "type": "float", + "name": "pk0" + }, + { + "type": "inet", + "name": "pk1" + }, + { + "type": "int", + "name": "pk2" + }, + { + "type": "smallint", + "name": "pk3" + }, + { + "type": "text", + "name": "pk4" + }, + { + "type": "timestamp", + "name": "pk5" + }, + { + "type": "timeuuid", + "name": "pk6" + } + ], + "clustering_keys": [ + { + "type": "ascii", + "name": "ck0" + }, + { + "type": "bigint", + "name": "ck1" + }, + { + "type": "blob", + "name": "ck2" + }, + { + "type": "boolean", + "name": "ck3" + }, + { + "type": "date", + "name": "ck4" + }, + { + "type": "decimal", + "name": "ck5" + }, + { + "type": "double", + "name": "ck6" + } + ] + } + ], + "known_issues": { + "https://github.com/scylladb/scylla/issues/3708": true + }, + "table_options": [ + "compression = {'sstable_compression':'LZ4Compressor'}", + "read_repair_chance = 1.0", + "comment = 'Important records'", + "cdc = {'enabled':'true','preimage':'true'}", + "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}" + ] + }, + { + "name": "tb2", + "partition_keys": [ + { + "type": "tinyint", + "name": "pk0" + }, + { + "type": "uuid", + "name": "pk1" + }, + { + "type": "varchar", + "name": "pk2" + }, + { + "type": "varint", + "name": "pk3" + }, + { + "type": "time", + "name": "pk4" + } + ], + "clustering_keys": [ + { + "type": "tinyint", + "name": "ck0" + }, + { + "type": "uuid", + "name": "ck1" + }, + { + "type": "varchar", + "name": "ck2" + }, + { + "type": "varint", + "name": "ck3" + }, + { + "type": "time", + "name": "ck4" + }, + { + "type": "duration", + "name": "ck5" + } + ], + "columns": [ + { + "type": { + "complex_type": "udt", + "value_types": { + "udt_10.1": "bigint", + "udt_10.2": "date", + "udt_10.3": "blob" + }, + "type_name": "udt_10", + "frozen": false + }, + "name": "col0" + }, + { + "type": { + "complex_type": "map", + "key_type": "inet", + "value_type": "time", + "frozen": true + }, + "name": "col1" + }, + { + "type": { + "complex_type": "tuple", + "value_types": [ + "float", + "date", + "varchar" + ], + "frozen": false + }, + "name": "col2" + }, + { + "type": { + "complex_type": "list", + "value_type": "uuid", + "frozen": true + }, + "name": "col3" + }, + { + "type": { + "complex_type": "set", + "value_type": "timestamp", + "frozen": false + }, + "name": "col4" + }, + { + "type": "decimal", + "name": "col5" + } + ], + "indexes": [ + { + "Column": null, + "index_name": "col0_idx", + "column_name": "col0" + }, + { + "Column": null, + "index_name": "col12_idx", + "column_name": "col12" + } + ], + "materialized_views": [ + { + "NonPrimaryKey": null, + "name": "mv0", + "partition_keys": [ + { + "type": "tinyint", + "name": "pk0" + }, + { + "type": "uuid", + "name": "pk1" + }, + { + "type": "varchar", + "name": "pk2" + }, + { + "type": "varint", + "name": "pk3" + }, + { + "type": "time", + "name": "pk4" + } + ], + "clustering_keys": [ + { + "type": "tinyint", + "name": "ck0" + }, + { + "type": "uuid", + "name": "ck1" + }, + { + "type": "varchar", + "name": "ck2" + }, + { + "type": "varint", + "name": "ck3" + }, + { + "type": "time", + "name": "ck4" + }, + { + "type": "duration", + "name": "ck5" + } + ] + } + ], + "known_issues": { + "https://github.com/scylladb/scylla/issues/3708": true + }, + "table_options": [ + "compression = {'sstable_compression':'LZ4Compressor'}", + "read_repair_chance = 1.0", + "comment = 'Important records'", + "cdc = {'enabled':'true','preimage':'true'}", + "compaction = {'class':'LeveledCompactionStrategy','enabled':true,'sstable_size_in_mb':160,'tombstone_compaction_interval':86400,'tombstone_threshold':0.2}" + ] + } + ] +} \ No newline at end of file