We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write directly in SQL to construct the map type, such as this:
SELECT {'a': {'b': 1}} as t1, map_put('b', {'c': 1}, t1) as t2 FROM "t/#"
All data types in the rule engine except map can be written directly in SQL, for example:
'a' as t1, 1 as t2, [t1, t2] as t3
But for the map type, I can't write like this:
{'a': 1} as t1
This causes the SQL to become difficult to write and read when we want to construct a new map based on the fields extracted above:
SELECT '1' as t1, '2' as t2, '3' as t3, map_put('t3', t3, map_put('t2', t2, map_put('t1', t1, map_new()))) as t4 FROM "t/#"
or
SELECT '1' as t1, '2' as t2, '3' as t3, map_put('t1', t1, map_new()) as t4, map_put('t2', t2, t4) as t5, map_put('t3', t3, t5) as t6 FROM "t/#"
In addition, the introduction of map types in the documentation of built-in functions also seems incompatible with other types:
length([1,2,3,4]) = 4 map_get('b', map_put('b', 1, json_decode('{"a": 1}'))) = 1 # Rather Than: map_get('a', {'a': {'b': {'c': 1}}}) = {'b': {'c': 1}}
I think there should not be a situation where a certain basic type cannot be written in a complete grammar system.
The text was updated successfully, but these errors were encountered:
string interpolation in general basically? does this work good enough?
SELECT interpolate('{"a": ${payload.a}, "b": ${payload.b}}') as my_json_obj
NOTE: there is no such function yet.
Sorry, something went wrong.
Actually I'm more looking forward to this format:
SELECT {'key': value}
wivwiv
No branches or pull requests
What would you like to be added or enhanced?
Write directly in SQL to construct the map type, such as this:
Why is this needed?
All data types in the rule engine except map can be written directly in SQL, for example:
But for the map type, I can't write like this:
This causes the SQL to become difficult to write and read when we want to construct a new map based on the fields extracted above:
or
In addition, the introduction of map types in the documentation of built-in functions also seems incompatible with other types:
I think there should not be a situation where a certain basic type cannot be written in a complete grammar system.
The text was updated successfully, but these errors were encountered: