Conversation
|
Hi @craigtaverner, I've created a changelog YAML for you. |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| FROM apps, apps_short | ||
| | EVAL x = id::integer | ||
| | FORK (WHERE true) (WHERE true) | ||
| | DROP _fork |
There was a problem hiding this comment.
can we do something with x after FORK? for example adding EVAL x = x + 1 or something similar?
just to validate that the value can be used.
ioanatia
left a comment
There was a problem hiding this comment.
We can also remove these lines here:
I tested your fix and it seems that it also solves the problem we had with the implicit casting for date and date nanos (which I just found out we took out of snapshot 🎉 ).
At the time we released FORK this was still under development and so it wasn't a priority to fix.
With GenerativeForkRestTest we test almost all csv specs, by adding at the end "FORK (WHERE true) (WHERE true) | WHERE _fork == "fork1" | DROP _fork". This new query using FORK should render the same results.
So I'd say that if we want to add more tests using FORK, it's less important to follow the same pattern with FORK (WHERE true) (WHERE true) and it's more important to see if the columns can be used after FORK, if there is any weirdness when the FORK columns have different outputs etc. I am happy to add more tests for it in a separate PR if we simply want to get this merged sooner.
|
Regarding the tests with @ioanatia did a amazing job by adding If we could have a combination of this test with what |
| @@ -1397,6 +1397,23 @@ event_duration:long | _index:keyword | ts:date | ts_str: | |||
| 8268153 | sample_data_ts_nanos | 2023-10-23T13:52:55.015Z | 2023-10-23T13:52:55.015123456Z | 1698069175015123456 | 172.21.3.15 | 172.21.3.15 | |||
| ; | |||
|
|
|||
There was a problem hiding this comment.
You might want to look at inlinestats.csv-spec file and search for https://github.com/elastic/elasticsearch/issues/133973. There are some ignored tests in there that need a check.
There was a problem hiding this comment.
We checked these tests cannot be unignored because there seems to be a bug with INLINESTATS in queries where we use a union type, which seems unrelated to what we've done for FORK:
FROM employees, employees_incompatible
| KEEP emp_no, hire_date
| EVAL yr = DATE_TRUNC(1 year, hire_date)
| INLINESTATS c = count(emp_no::long) BY yr
| SORT yr DESC
| LIMIT 5
;
To be investigated as a separate piece of work
That's a good idea. |
FORKcreatesReferenceAttributesthat represent the combination of the underlyingFieldAttributesinside each forked sub-plan. However, union-types uses syntheticFieldAttributesto represent the underlying originalFieldAttributesconverted to a single type. These synthetic attributes are removed in the last phase of semantic analysis usingDROPcommands (Project), but the code to do that does not handle theReferenceAttributesprovided byFORK. The simplest approach to fixing this is not restrict the check toFieldAttributes, but only check forattr.synthetic().It would seem the only special case we need to deal with is the
NO_FIELDSspecial field which is bothsyntheticand aReferenceAttribute, and should not be touched by the union-types cleanup code.Fixes #133973