mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
Implement `expr:valuate()` for `expr::field_selection`. `field_selection` is used to represent access to a struct field. For example, with a UDT value: ``` CREATE TYPE my_type (a int, b int); ``` The expression `my_type_value.a` would be represented as a `field_selection`, which selects the field `a`. Evaluating such an expression consists of finding the right element's value in a serialized UDT value and returning it. Note that it's still not possible to use `field_selection` inside the `WHERE` clause. Enabling it would require changes to the grammar, as well as query planning, Current `statement_restrictions` just reacts with `on_internal_error` when it encounters a `field_selection`. Nonetheless it's a step towards relaxing the grammar, and now it's finally possible to evaluate all kinds of prepared expressions (#12906) Fixes: https://github.com/scylladb/scylladb/issues/12906 Closes #14235 * github.com:scylladb/scylladb: boost/expr_test: test evaluate(field_selection) cql3/expr: fix printing of field_selection cql3/expression: implement evaluate(field_selection) types/user: modify idx_of_field to use bytes_view column_identifer: add column_identifier_raw::text() types: add read_nth_user_type_field() types: add read_nth_tuple_element()