paul-rogers commented on pull request #12241:
URL: https://github.com/apache/druid/pull/12241#issuecomment-1033035013
Nice improvement! The new format should be easier to work with in code. The
format is only partly an AST. It still creates named arguments, which adds more
structure than is really necessary. Did you consider something that is an
actual expression tree?
```json
"virtualColumns":[
{
"type":"fn",
"fn":"array_length",
"outputType":"LONG",
"args":[
{
"type:":"fn",
"fn:":"filter",
"args":[
{
"type":"lambda",
"output":"dim3",
"input_args":[
"x"
],
"args":[ {
"type":"fn",
"fn":"array",
"args":[ {
"type":"col-ref",
"name":"b"
}, {
"type":"arg-ref",
"name":"x"
} ] } ] ] ] ] }
} ],
```
The gist is, rather than have a node for every operation (a large number),
have nodes for the expression elements: functions, literals, column references,
etc. One ends up with a handful of node types rather than many dozens.
Calcite should produce a tree something like this, so the translation from
Calcite is pretty simple.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]