package systemtables

type columnDef struct {
	Name string
	Type string
}

type tableDef struct {
	Keyspace        string
	Table           string
	Columns         []columnDef
	PartitionKeys   []string
	ClusteringKeys  []string
	ClusteringOrder map[string]string
}

var builtinSystemTableDefs = []tableDef{
	{
		Keyspace: "system",
		Table:    "batches",
		Columns: []columnDef{
			{Name: "id", Type: "timeuuid"},
			{Name: "mutations", Type: "list<blob>"},
			{Name: "version", Type: "int"},
		},
		PartitionKeys:   []string{"id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "paxos",
		Columns: []columnDef{
			{Name: "row_key", Type: "blob"},
			{Name: "cf_id", Type: "uuid"},
			{Name: "in_progress_ballot", Type: "timeuuid"},
			{Name: "in_progress_read_ballot", Type: "timeuuid"},
			{Name: "most_recent_commit", Type: "blob"},
			{Name: "most_recent_commit_at", Type: "timeuuid"},
			{Name: "most_recent_commit_version", Type: "int"},
			{Name: "proposal", Type: "blob"},
			{Name: "proposal_ballot", Type: "timeuuid"},
			{Name: "proposal_version", Type: "int"},
		},
		PartitionKeys:   []string{"row_key"},
		ClusteringKeys:  []string{"cf_id"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "consensus_migration_state",
		Columns: []columnDef{
			{Name: "row_key", Type: "blob"},
			{Name: "cf_id", Type: "uuid"},
			{Name: "consensus_migrated_at_epoch", Type: "bigint"},
			{Name: "consensus_max_hlc", Type: "bigint"},
			{Name: "consensus_target", Type: "tinyint"},
		},
		PartitionKeys:  []string{"row_key"},
		ClusteringKeys: []string{"cf_id", "consensus_migrated_at_epoch"},
		ClusteringOrder: map[string]string{
			"cf_id":                       "ASC",
			"consensus_migrated_at_epoch": "DESC",
		},
	},
	{
		Keyspace: "system",
		Table:    "paxos_repair_history",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "points", Type: "frozen<list<tuple<blob, timeuuid>>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "IndexInfo",
		Columns: []columnDef{
			{Name: "table_name", Type: "text"},
			{Name: "index_name", Type: "text"},
			{Name: "value", Type: "blob"},
		},
		PartitionKeys:   []string{"table_name"},
		ClusteringKeys:  []string{"index_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "local",
		Columns: []columnDef{
			{Name: "key", Type: "text"},
			{Name: "bootstrapped", Type: "text"},
			{Name: "broadcast_address", Type: "inet"},
			{Name: "broadcast_port", Type: "int"},
			{Name: "cluster_name", Type: "text"},
			{Name: "cql_version", Type: "text"},
			{Name: "data_center", Type: "text"},
			{Name: "gossip_generation", Type: "int"},
			{Name: "host_id", Type: "uuid"},
			{Name: "listen_address", Type: "inet"},
			{Name: "listen_port", Type: "int"},
			{Name: "native_protocol_version", Type: "text"},
			{Name: "partitioner", Type: "text"},
			{Name: "rack", Type: "text"},
			{Name: "release_version", Type: "text"},
			{Name: "rpc_address", Type: "inet"},
			{Name: "rpc_port", Type: "int"},
			{Name: "schema_version", Type: "uuid"},
			{Name: "tokens", Type: "set<varchar>"},
			{Name: "truncated_at", Type: "map<uuid, blob>"},
		},
		PartitionKeys:   []string{"key"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "peers_v2",
		Columns: []columnDef{
			{Name: "peer", Type: "inet"},
			{Name: "peer_port", Type: "int"},
			{Name: "data_center", Type: "text"},
			{Name: "host_id", Type: "uuid"},
			{Name: "preferred_ip", Type: "inet"},
			{Name: "preferred_port", Type: "int"},
			{Name: "rack", Type: "text"},
			{Name: "release_version", Type: "text"},
			{Name: "native_address", Type: "inet"},
			{Name: "native_port", Type: "int"},
			{Name: "schema_version", Type: "uuid"},
			{Name: "tokens", Type: "set<varchar>"},
		},
		PartitionKeys:   []string{"peer"},
		ClusteringKeys:  []string{"peer_port"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "peer_events_v2",
		Columns: []columnDef{
			{Name: "peer", Type: "inet"},
			{Name: "peer_port", Type: "int"},
			{Name: "hints_dropped", Type: "map<timeuuid, int>"},
		},
		PartitionKeys:   []string{"peer"},
		ClusteringKeys:  []string{"peer_port"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "compaction_history",
		Columns: []columnDef{
			{Name: "id", Type: "timeuuid"},
			{Name: "bytes_in", Type: "bigint"},
			{Name: "bytes_out", Type: "bigint"},
			{Name: "columnfamily_name", Type: "text"},
			{Name: "compacted_at", Type: "timestamp"},
			{Name: "keyspace_name", Type: "text"},
			{Name: "rows_merged", Type: "map<int, bigint>"},
			{Name: "compaction_properties", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "sstable_activity_v2",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "id", Type: "text"},
			{Name: "rate_120m", Type: "double"},
			{Name: "rate_15m", Type: "double"},
		},
		PartitionKeys:   []string{"keyspace_name", "table_name", "id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "table_estimates",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "range_type", Type: "text"},
			{Name: "range_start", Type: "text"},
			{Name: "range_end", Type: "text"},
			{Name: "mean_partition_size", Type: "bigint"},
			{Name: "partitions_count", Type: "bigint"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "range_type", "range_start", "range_end"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "available_ranges_v2",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "full_ranges", Type: "set<blob>"},
			{Name: "transient_ranges", Type: "set<blob>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "transferred_ranges_v2",
		Columns: []columnDef{
			{Name: "operation", Type: "text"},
			{Name: "peer", Type: "inet"},
			{Name: "peer_port", Type: "int"},
			{Name: "keyspace_name", Type: "text"},
			{Name: "ranges", Type: "set<blob>"},
		},
		PartitionKeys:   []string{"operation", "keyspace_name"},
		ClusteringKeys:  []string{"peer", "peer_port"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "view_builds_in_progress",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "view_name", Type: "text"},
			{Name: "start_token", Type: "varchar"},
			{Name: "end_token", Type: "varchar"},
			{Name: "last_token", Type: "varchar"},
			{Name: "keys_built", Type: "bigint"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"view_name", "start_token", "end_token"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "built_views",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "view_name", Type: "text"},
			{Name: "status_replicated", Type: "boolean"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"view_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "prepared_statements",
		Columns: []columnDef{
			{Name: "prepared_id", Type: "blob"},
			{Name: "logged_keyspace", Type: "text"},
			{Name: "query_string", Type: "text"},
		},
		PartitionKeys:   []string{"prepared_id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "repairs",
		Columns: []columnDef{
			{Name: "parent_id", Type: "timeuuid"},
			{Name: "started_at", Type: "timestamp"},
			{Name: "last_update", Type: "timestamp"},
			{Name: "repaired_at", Type: "timestamp"},
			{Name: "state", Type: "int"},
			{Name: "coordinator", Type: "inet"},
			{Name: "coordinator_port", Type: "int"},
			{Name: "participants", Type: "set<inet>"},
			{Name: "participants_wp", Type: "set<text>"},
			{Name: "ranges", Type: "set<blob>"},
			{Name: "cfids", Type: "set<uuid>"},
		},
		PartitionKeys:   []string{"parent_id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "top_partitions",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "top_type", Type: "text"},
			{Name: "top", Type: "frozen<list<tuple<text, bigint>>>"},
			{Name: "last_update", Type: "timestamp"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "top_type"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "local_metadata_log",
		Columns: []columnDef{
			{Name: "epoch", Type: "bigint"},
			{Name: "entry_id", Type: "bigint"},
			{Name: "transformation", Type: "blob"},
			{Name: "kind", Type: "int"},
		},
		PartitionKeys:   []string{"epoch"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "metadata_snapshots",
		Columns: []columnDef{
			{Name: "epoch", Type: "bigint"},
			{Name: "snapshot", Type: "blob"},
		},
		PartitionKeys:   []string{"epoch"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "peers",
		Columns: []columnDef{
			{Name: "peer", Type: "inet"},
			{Name: "data_center", Type: "text"},
			{Name: "host_id", Type: "uuid"},
			{Name: "preferred_ip", Type: "inet"},
			{Name: "rack", Type: "text"},
			{Name: "release_version", Type: "text"},
			{Name: "rpc_address", Type: "inet"},
			{Name: "schema_version", Type: "uuid"},
			{Name: "tokens", Type: "set<varchar>"},
		},
		PartitionKeys:   []string{"peer"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "peer_events",
		Columns: []columnDef{
			{Name: "peer", Type: "inet"},
			{Name: "hints_dropped", Type: "map<timeuuid, int>"},
		},
		PartitionKeys:   []string{"peer"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "transferred_ranges",
		Columns: []columnDef{
			{Name: "operation", Type: "text"},
			{Name: "peer", Type: "inet"},
			{Name: "keyspace_name", Type: "text"},
			{Name: "ranges", Type: "set<blob>"},
		},
		PartitionKeys:   []string{"operation", "keyspace_name"},
		ClusteringKeys:  []string{"peer"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "available_ranges",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "ranges", Type: "set<blob>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "size_estimates",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "range_start", Type: "text"},
			{Name: "range_end", Type: "text"},
			{Name: "mean_partition_size", Type: "bigint"},
			{Name: "partitions_count", Type: "bigint"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "range_start", "range_end"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system",
		Table:    "sstable_activity",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "columnfamily_name", Type: "text"},
			{Name: "generation", Type: "int"},
			{Name: "rate_120m", Type: "double"},
			{Name: "rate_15m", Type: "double"},
		},
		PartitionKeys:   []string{"keyspace_name", "columnfamily_name", "generation"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "keyspaces",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "durable_writes", Type: "boolean"},
			{Name: "replication", Type: "frozen<map<text, text>>"},
			{Name: "fast_path", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "tables",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "allow_auto_snapshot", Type: "boolean"},
			{Name: "bloom_filter_fp_chance", Type: "double"},
			{Name: "caching", Type: "frozen<map<text, text>>"},
			{Name: "comment", Type: "text"},
			{Name: "compaction", Type: "frozen<map<text, text>>"},
			{Name: "compression", Type: "frozen<map<text, text>>"},
			{Name: "memtable", Type: "text"},
			{Name: "crc_check_chance", Type: "double"},
			{Name: "dclocal_read_repair_chance", Type: "double"},
			{Name: "default_time_to_live", Type: "int"},
			{Name: "extensions", Type: "frozen<map<text, blob>>"},
			{Name: "flags", Type: "frozen<set<text>>"},
			{Name: "gc_grace_seconds", Type: "int"},
			{Name: "incremental_backups", Type: "boolean"},
			{Name: "id", Type: "uuid"},
			{Name: "max_index_interval", Type: "int"},
			{Name: "memtable_flush_period_in_ms", Type: "int"},
			{Name: "min_index_interval", Type: "int"},
			{Name: "read_repair_chance", Type: "double"},
			{Name: "speculative_retry", Type: "text"},
			{Name: "additional_write_policy", Type: "text"},
			{Name: "cdc", Type: "boolean"},
			{Name: "read_repair", Type: "text"},
			{Name: "fast_path", Type: "frozen<map<text, text>>"},
			{Name: "auto_repair", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "columns",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "column_name", Type: "text"},
			{Name: "clustering_order", Type: "text"},
			{Name: "column_name_bytes", Type: "blob"},
			{Name: "default_expr", Type: "text"},
			{Name: "on_update_expr", Type: "text"},
			{Name: "kind", Type: "text"},
			{Name: "position", Type: "int"},
			{Name: "type", Type: "text"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "column_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "column_masks",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "column_name", Type: "text"},
			{Name: "function_keyspace", Type: "text"},
			{Name: "function_name", Type: "text"},
			{Name: "function_argument_types", Type: "frozen<list<text>>"},
			{Name: "function_argument_values", Type: "frozen<list<text>>"},
			{Name: "function_argument_nulls", Type: "frozen<list<boolean>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "column_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "dropped_columns",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "column_name", Type: "text"},
			{Name: "dropped_time", Type: "timestamp"},
			{Name: "kind", Type: "text"},
			{Name: "type", Type: "text"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "column_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "triggers",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "trigger_name", Type: "text"},
			{Name: "options", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "trigger_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "views",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "view_name", Type: "text"},
			{Name: "base_table_id", Type: "uuid"},
			{Name: "base_table_name", Type: "text"},
			{Name: "where_clause", Type: "text"},
			{Name: "allow_auto_snapshot", Type: "boolean"},
			{Name: "bloom_filter_fp_chance", Type: "double"},
			{Name: "caching", Type: "frozen<map<text, text>>"},
			{Name: "comment", Type: "text"},
			{Name: "compaction", Type: "frozen<map<text, text>>"},
			{Name: "compression", Type: "frozen<map<text, text>>"},
			{Name: "memtable", Type: "text"},
			{Name: "crc_check_chance", Type: "double"},
			{Name: "dclocal_read_repair_chance", Type: "double"},
			{Name: "default_time_to_live", Type: "int"},
			{Name: "extensions", Type: "frozen<map<text, blob>>"},
			{Name: "gc_grace_seconds", Type: "int"},
			{Name: "incremental_backups", Type: "boolean"},
			{Name: "id", Type: "uuid"},
			{Name: "include_all_columns", Type: "boolean"},
			{Name: "max_index_interval", Type: "int"},
			{Name: "memtable_flush_period_in_ms", Type: "int"},
			{Name: "min_index_interval", Type: "int"},
			{Name: "read_repair_chance", Type: "double"},
			{Name: "speculative_retry", Type: "text"},
			{Name: "additional_write_policy", Type: "text"},
			{Name: "cdc", Type: "boolean"},
			{Name: "read_repair", Type: "text"},
			{Name: "auto_repair", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"view_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "indexes",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "index_name", Type: "text"},
			{Name: "kind", Type: "text"},
			{Name: "options", Type: "frozen<map<text, text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"table_name", "index_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "types",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "type_name", Type: "text"},
			{Name: "field_names", Type: "frozen<list<text>>"},
			{Name: "field_types", Type: "frozen<list<text>>"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"type_name"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "functions",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "function_name", Type: "text"},
			{Name: "argument_types", Type: "frozen<list<text>>"},
			{Name: "argument_names", Type: "frozen<list<text>>"},
			{Name: "body", Type: "text"},
			{Name: "language", Type: "text"},
			{Name: "return_type", Type: "text"},
			{Name: "called_on_null_input", Type: "boolean"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"function_name", "argument_types"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_schema",
		Table:    "aggregates",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "aggregate_name", Type: "text"},
			{Name: "argument_types", Type: "frozen<list<text>>"},
			{Name: "final_func", Type: "text"},
			{Name: "initcond", Type: "text"},
			{Name: "return_type", Type: "text"},
			{Name: "state_func", Type: "text"},
			{Name: "state_type", Type: "text"},
		},
		PartitionKeys:   []string{"keyspace_name"},
		ClusteringKeys:  []string{"aggregate_name", "argument_types"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "roles",
		Columns: []columnDef{
			{Name: "role", Type: "text"},
			{Name: "is_superuser", Type: "boolean"},
			{Name: "can_login", Type: "boolean"},
			{Name: "salted_hash", Type: "text"},
			{Name: "member_of", Type: "set<text>"},
		},
		PartitionKeys:   []string{"role"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "identity_to_role",
		Columns: []columnDef{
			{Name: "identity", Type: "text"},
			{Name: "role", Type: "text"},
		},
		PartitionKeys:   []string{"identity"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "role_members",
		Columns: []columnDef{
			{Name: "role", Type: "text"},
			{Name: "member", Type: "text"},
		},
		PartitionKeys:   []string{"role"},
		ClusteringKeys:  []string{"member"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "role_permissions",
		Columns: []columnDef{
			{Name: "role", Type: "text"},
			{Name: "resource", Type: "text"},
			{Name: "permissions", Type: "set<text>"},
		},
		PartitionKeys:   []string{"role"},
		ClusteringKeys:  []string{"resource"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "resource_role_permissons_index",
		Columns: []columnDef{
			{Name: "resource", Type: "text"},
			{Name: "role", Type: "text"},
		},
		PartitionKeys:   []string{"resource"},
		ClusteringKeys:  []string{"role"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "network_permissions",
		Columns: []columnDef{
			{Name: "role", Type: "text"},
			{Name: "dcs", Type: "frozen<set<text>>"},
		},
		PartitionKeys:   []string{"role"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "cidr_permissions",
		Columns: []columnDef{
			{Name: "role", Type: "text"},
			{Name: "cidr_groups", Type: "frozen<set<text>>"},
		},
		PartitionKeys:   []string{"role"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_auth",
		Table:    "cidr_groups",
		Columns: []columnDef{
			{Name: "cidr_group", Type: "text"},
			{Name: "cidrs", Type: "frozen<set<tuple<inet, smallint>>>"},
		},
		PartitionKeys:   []string{"cidr_group"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_traces",
		Table:    "sessions",
		Columns: []columnDef{
			{Name: "session_id", Type: "uuid"},
			{Name: "command", Type: "text"},
			{Name: "client", Type: "inet"},
			{Name: "coordinator", Type: "inet"},
			{Name: "coordinator_port", Type: "int"},
			{Name: "duration", Type: "int"},
			{Name: "parameters", Type: "map<text, text>"},
			{Name: "request", Type: "text"},
			{Name: "started_at", Type: "timestamp"},
		},
		PartitionKeys:   []string{"session_id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_traces",
		Table:    "events",
		Columns: []columnDef{
			{Name: "session_id", Type: "uuid"},
			{Name: "event_id", Type: "timeuuid"},
			{Name: "activity", Type: "text"},
			{Name: "source", Type: "inet"},
			{Name: "source_port", Type: "int"},
			{Name: "source_elapsed", Type: "int"},
			{Name: "thread", Type: "text"},
		},
		PartitionKeys:   []string{"session_id"},
		ClusteringKeys:  []string{"event_id"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "repair_history",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "columnfamily_name", Type: "text"},
			{Name: "id", Type: "timeuuid"},
			{Name: "parent_id", Type: "timeuuid"},
			{Name: "range_begin", Type: "text"},
			{Name: "range_end", Type: "text"},
			{Name: "coordinator", Type: "inet"},
			{Name: "coordinator_port", Type: "int"},
			{Name: "participants", Type: "set<inet>"},
			{Name: "participants_v2", Type: "set<text>"},
			{Name: "exception_message", Type: "text"},
			{Name: "exception_stacktrace", Type: "text"},
			{Name: "status", Type: "text"},
			{Name: "started_at", Type: "timestamp"},
			{Name: "finished_at", Type: "timestamp"},
		},
		PartitionKeys:   []string{"keyspace_name", "columnfamily_name"},
		ClusteringKeys:  []string{"id"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "parent_repair_history",
		Columns: []columnDef{
			{Name: "parent_id", Type: "timeuuid"},
			{Name: "keyspace_name", Type: "text"},
			{Name: "columnfamily_names", Type: "set<text>"},
			{Name: "started_at", Type: "timestamp"},
			{Name: "finished_at", Type: "timestamp"},
			{Name: "exception_message", Type: "text"},
			{Name: "exception_stacktrace", Type: "text"},
			{Name: "requested_ranges", Type: "set<text>"},
			{Name: "successful_ranges", Type: "set<text>"},
			{Name: "options", Type: "map<text, text>"},
		},
		PartitionKeys:   []string{"parent_id"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "view_build_status",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "view_name", Type: "text"},
			{Name: "host_id", Type: "uuid"},
			{Name: "status", Type: "text"},
		},
		PartitionKeys:   []string{"keyspace_name", "view_name"},
		ClusteringKeys:  []string{"host_id"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "partition_denylist",
		Columns: []columnDef{
			{Name: "ks_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "key", Type: "blob"},
		},
		PartitionKeys:   []string{"ks_name", "table_name"},
		ClusteringKeys:  []string{"key"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "auto_repair_history",
		Columns: []columnDef{
			{Name: "host_id", Type: "uuid"},
			{Name: "repair_type", Type: "text"},
			{Name: "repair_turn", Type: "text"},
			{Name: "repair_start_ts", Type: "timestamp"},
			{Name: "repair_finish_ts", Type: "timestamp"},
			{Name: "delete_hosts", Type: "set<uuid>"},
			{Name: "delete_hosts_update_time", Type: "timestamp"},
			{Name: "force_repair", Type: "boolean"},
		},
		PartitionKeys:   []string{"repair_type"},
		ClusteringKeys:  []string{"host_id"},
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "auto_repair_priority",
		Columns: []columnDef{
			{Name: "repair_type", Type: "text"},
			{Name: "repair_priority", Type: "set<uuid>"},
		},
		PartitionKeys:   []string{"repair_type"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_distributed",
		Table:    "compression_dictionaries",
		Columns: []columnDef{
			{Name: "keyspace_name", Type: "text"},
			{Name: "table_name", Type: "text"},
			{Name: "kind", Type: "text"},
			{Name: "dict_id", Type: "bigint"},
			{Name: "dict", Type: "blob"},
			{Name: "dict_length", Type: "int"},
			{Name: "dict_checksum", Type: "int"},
		},
		PartitionKeys:  []string{"keyspace_name", "table_name"},
		ClusteringKeys: []string{"dict_id"},
		ClusteringOrder: map[string]string{
			"dict_id": "DESC",
		},
	},
	{
		Keyspace: "system_cluster_metadata",
		Table:    "distributed_metadata_log",
		Columns: []columnDef{
			{Name: "epoch", Type: "bigint"},
			{Name: "entry_id", Type: "bigint"},
			{Name: "transformation", Type: "blob"},
			{Name: "kind", Type: "int"},
		},
		PartitionKeys:   []string{"epoch"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
	{
		Keyspace: "system_accord",
		Table:    "journal",
		Columns: []columnDef{
			{Name: "key", Type: "blob"},
			{Name: "descriptor", Type: "bigint"},
			{Name: "offset", Type: "int"},
			{Name: "user_version", Type: "int"},
			{Name: "record", Type: "blob"},
		},
		PartitionKeys:  []string{"key"},
		ClusteringKeys: []string{"descriptor", "offset"},
		ClusteringOrder: map[string]string{
			"descriptor": "DESC",
			"offset":     "DESC",
		},
	},
	{
		Keyspace: "system_accord",
		Table:    "commands_for_key",
		Columns: []columnDef{
			{Name: "key", Type: "blob"},
			{Name: "data", Type: "blob"},
		},
		PartitionKeys:   []string{"key"},
		ClusteringKeys:  nil,
		ClusteringOrder: nil,
	},
}
