Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
Dynamic columns should be referred by names (now only numeric references supported).
Numeric (current) format of dynamic columns string is:
fixed part |
---|
1 byte flags (now stores <offset size> - 1 in first 2 bits) |
2 bytes column counter |
fixed size column headers sorted by column number, each entry contains of: |
2 bytes column number |
1-4 bytes combined offset from beginning of the data segment + 3 bit type |
data of above columns size of data and length depend on type |
For columns with names proposed following format. I think in this format numeric references could be written as strings.
fixed part |
---|
1 byte flags (now stores <offset size> - 1 in first 2 bits, and 1 bit to set this new format) |
2 bytes column counter |
2 bytes size of stored names pool |
fixed size column headers sorted by names, each consists of |
1 byte length of the name |
2 bytes offset of name |
1-4 bytes combined offset from beginning of the data segment + 3 bit type |
names stored one after another |
data of above columns size of data and length depend on type |
there was other ideas which I think is not so good:
- store names just in header part (then it looses its array properties and binary search)
- store both headers numbers and names (I doubts that both way of references could be used simultaneously). (We have agreed this is not possible, because name↔number mapping must be the same for every record in the table, and there is no way we could efficiently maintain this mapping. For example, HBase does not provide any fast way to get a full list of column names).
Limitations:
- each name not more then 255 symbols
- sum of all names length cant be more then 65535
New format used if
- at least one of dynamic column references has non integer type.
or - dynamic column string on which operation performed has new format
New low level interface functions:
Parameters of creating/changing functions:
DYNAMIC_COLUMN *str | the dynamic column. |
uchar *column_keys | array of uint or LEX_STRING keys depends on names |
DYNAMIC_COLUMN_VALUE *values | array of values |
uint column_count | number of above arrays |
my_bool names | TRUE if names are character strings |
enum enum_dyncol_func_result
|
dynamic_column_create_many_fmt(DYNAMIC_COLUMN *str,
|
uint column_count,
|
uchar *column_keys,
|
DYNAMIC_COLUMN_VALUE *values,
|
my_bool names);
|
enum enum_dyncol_func_result
|
dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str,
|
uint add_column_count,
|
void *column_keys,
|
DYNAMIC_COLUMN_VALUE *values,
|
my_bool string_keys);
|
Check existence of column (not null) (2 functions, one is addition to old
function, other is universal)
enum enum_dyncol_func_result
|
dynamic_column_exists_str(DYNAMIC_COLUMN *str, LEX_STRING *name);
|
enum enum_dyncol_func_result
|
dynamic_column_exists_fmt(DYNAMIC_COLUMN *str, void *key, my_bool string_keys);
|
Get list of of columns (works for both formats):
enum enum_dyncol_func_result
|
dynamic_column_list_str(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_lexstr);
|
Get column value (2 functions, one is addition to old
function, other is universal)
enum enum_dyncol_func_result
|
dynamic_column_get_str(DYNAMIC_COLUMN *str, LEX_STRING *name,
|
DYNAMIC_COLUMN_VALUE *store_it_here);
|
enum enum_dyncol_func_result
|
dynamic_column_get_fmt(DYNAMIC_COLUMN *str, void *key,
|
DYNAMIC_COLUMN_VALUE *store_it_here,
|
my_bool names)
|
Check the string format:
my_bool dynamic_column_has_names(DYNAMIC_COLUMN *str);
|
Attachments
Issue Links
- is part of
-
MDEV-431 Cassandra storage engine
- Closed
-
MDEV-506 Cassandra dynamic columns access
- Closed
- relates to
-
MDEV-122 Data mapping between HBase and SQL
- Closed
-
MDEV-458 DNAMES: Server crashes on using an unquoted string as a dynamic column name
- Closed
-
MDEV-459 DNAMES: column_list returns an empty string if at least one column has a symbolic name
- Closed
-
MDEV-460 DNAMES: main.dyncol test produces mismatches (extra 'set names' calls which are not included into the result file)
- Closed
-
MDEV-461 DNAMES: column names do not work with non-trivial encodings
- Closed
-
MDEV-488 DNAMES: Assertion `column_name->length < 255' failed on a column name with length 255 (precisely)
- Closed
-
MDEV-489 DNAMES: Assertion `offset < 0x1f' failed in type_and_offset_store on COLUMN_ADD
- Closed
-
MDEV-490 DNAMES: Server crashes in Item_dyncol_get::get_dyn_value => String::charset on COLUMN_GET with NULL as a column number/name
- Closed
-
MDEV-491 DNAMES: Server crashes in Item_func_dyncol_exists::val_int => String::charset with NULL as a column name/number
- Closed
-
MDEV-558 DNAMES: Adding a column with a too long name corrupts previously inserted data
- Closed
-
MDEV-560 Cassandra: DynCols: Server crashes in ha_cassandra::read_cassandra_columns on reading from a dynamic column
- Closed
-
MDEV-561 Cassandra: DynCols: debugger aborting because missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "ha_cassandra::write_row"
- Closed
-
MDEV-565 Cassandra: DynCols: Server crashes in ha_cassandra::write_row on inserting NULL into a dynamic column
- Closed