cql3: expr: Add column_maybe_subscripted

column_maybe_subscripted is a variant that
can be either a column_value or a subscript.

It will be used as an argument to functions
which used to take column_value.

Right now column_value has a sub field,
but this will be removed soon once
the subscript struct takes over.

Changing the argument type is a smaller change
than rewriting all these functions, although
if they were rewritten the resulting code
would probably be nicer.

Signed-off-by: Jan Ciolek <jan.ciolek@scylladb.com>
This commit is contained in:
Jan Ciolek
2022-02-24 15:36:31 +01:00
parent 4d7438d30a
commit feee6e4ffb

View File

@@ -143,6 +143,9 @@ managed_bytes_opt get_value(const column_value& col, const column_value_eval_bag
}
}
/// column that might be subscripted - e.g col1, col2, col3[sub1]
using column_maybe_subscripted = std::variant<const column_value*, const subscript*>;
/// Type for comparing results of get_value().
const abstract_type* get_value_comparator(const column_definition* cdef) {
return &cdef->type->without_reversed();