The order of columns that belong to partition key or clustering key
needs to be preserved.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
We have been leaving all the setter functions in the schema_builder, which is
usually fine.
The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We have been leaving all the setter functions in the schema_builder, which is
usually fine.
The system tables, however, are not built this way, which means we need set
properties needed by them in some other way.
Most properties are right there in the constructor, but I argue that this one
does not belong there.
Instead, provide a set method so that the system tables which need it can call.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
All CFMetaData has a type, either Standard or Super. Right now, we do not
support Super, but we still would like to query for it, and use that information
to build our schemas.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Persist column family's "is_dense" value to system tables. Please note
that we throw an exception if "is_dense" is null upon read. That needs
to be fixed later by inferring the value from other information like
Origin does.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Store the column family key validator in system tables. Please note that
we derive the validator from CQL partition keys and never actually read
it from the database. This is different from Origin which uses
CompositeType that is both stored and read from the system tables.
Fixes#7.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Tested-by: Pekka Enberg <penberg@cloudius-systems.com>
Compressor type is only a part of the information kept in compressor
parameters and things like schema.get_compressor().get_compressor()
do not look very good.
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
Add a position() helper function that returns component index if there
is one and zero if there isn't. This is similar to what
ColumnDefinition.position() does in Origin. We will use this for a table
creation mutation.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
The field compressor is about saying which compressor algorithm
must be used in compression of sstable data file.
This is a small step towards compressed sstable data file.
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Table merging code needs to compare schema_ptrs for equality so add
comparison operators for column_definition and schema classes.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add methods to get and manipulate the current bloom filter false positive
chance - this is a per-cf field that lives in CFMetaData for Origin, so we'll
have it in the schema.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Also replace derived types (map_type, collection_type, etc.).
As we'll change data_type's definition, this reduces the number of places
that need to be modified later, and is more readable.
From Pekka:
"This patch series converts LegacySchemaTables keyspace merging code to
C++. After this series, keyspaces are actually created as demonstrated
by the newly added test in cql_query_test.cc."
Use decorated_key in partition maps, from Tomasz:
"Partitions should be ordered using Origin's ordering, which is the natural
ordering of decorated_key. This is achieved by switching column_family's
partition map to use decorated_key instead of a bare partition_key.
This also includes some cleanups."
[avi] trivial adjustments to sstables/keys.cc
If we end up including more than one boost::<>::join, like
boost::range::join and boost::string::join, that will create an ambiguity.
The compiler doesn't like it very much.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Needed by the cf_prop_defs class to modify a schema object in the
apply_to_cf_metadata() function.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Schema has containers which hash pointers to column definitions
embedded in the schema. It's not safe to just copy those, we need to
rehash them using new locations.
tuple_type is for managing our internal representation of keys. It
shares some interface with abstract_type, but the latter is a basis
for types of data stored in cells. tuple_type does not need to hide
behind a virtual interface.
Note: there is a TupleType in Origin, but it serves a different purpose.