-
Notifications
You must be signed in to change notification settings - Fork 25.6k
ESQL: Fix union types lost attributes in StubRelation for inlinestats #135547
New issue
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
Changes from all commits
2e28621
7ad6cac
60d2830
f841cf1
3120247
4d309ba
f3a297a
e7bc3df
8d14ae4
9ab4d4d
2410d1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 135547 | ||
| summary: Fix union types lost attributes in `StubRelation` for inlinestats | ||
| area: ES|QL | ||
| type: bug | ||
| issues: [] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3498,86 +3498,121 @@ warningRegex:java.lang.IllegalArgumentException: milliSeconds \[-1457696696640\] | |
| 2023-10-23T13:53:55.832Z |2023-10-23T13:53:55.832987654Z|1698069235832987654|19 | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedDateTruncInlinestats_By-Ignore | ||
| required_capability: inline_stats | ||
| // https://github.com/elastic/elasticsearch/issues/133973 | ||
| // optimized incorrectly due to missing references [$$emp_no$converted_to$long{f$}# | ||
| InlineStatsCountUnionType | ||
| required_capability: inline_stats_with_union_types_in_stub_relation | ||
|
|
||
| FROM employees, employees_incompatible | ||
| | KEEP emp_no, hire_date | ||
| | INLINE STATS c = count(emp_no::long) | ||
| | SORT hire_date DESC | ||
| | LIMIT 10 | ||
| ; | ||
|
|
||
| emp_no:unsupported | hire_date:date_nanos | c:long | ||
| null | 1999-04-30T00:00:00.000Z | 200 | ||
| null | 1999-04-30T00:00:00.000Z | 200 | ||
| null | 1997-05-19T00:00:00.000Z | 200 | ||
| null | 1997-05-19T00:00:00.000Z | 200 | ||
| null | 1996-11-05T00:00:00.000Z | 200 | ||
| null | 1996-11-05T00:00:00.000Z | 200 | ||
| null | 1995-12-15T00:00:00.000Z | 200 | ||
| null | 1995-12-15T00:00:00.000Z | 200 | ||
| null | 1995-08-22T00:00:00.000Z | 200 | ||
| null | 1995-08-22T00:00:00.000Z | 200 | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedDateTruncInlinestats_By | ||
| required_capability: inline_stats_with_union_types_in_stub_relation | ||
|
|
||
| FROM employees, employees_incompatible | ||
| | KEEP emp_no, hire_date | ||
| | INLINE STATS c = count(emp_no::long) BY yr = DATE_TRUNC(1 year, hire_date) | ||
| | SORT yr DESC | ||
| | LIMIT 5 | ||
| | SORT yr DESC, hire_date DESC | ||
| | LIMIT 10 | ||
| ; | ||
|
|
||
| c:long | yr:date_nanos | ||
| 2 | 1999-01-01T00:00:00.000Z | ||
| 2 | 1997-01-01T00:00:00.000Z | ||
| 2 | 1996-01-01T00:00:00.000Z | ||
| 10 | 1995-01-01T00:00:00.000Z | ||
| 8 | 1994-01-01T00:00:00.000Z | ||
| emp_no:unsupported | hire_date:date_nanos |c:long | yr:date_nanos | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithFilter-Ignore | ||
| required_capability: inline_stats | ||
| // https://github.com/elastic/elasticsearch/issues/133973 | ||
| // optimized incorrectly due to missing references [$$emp_no$converted_to$long{f$}# | ||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithFilter | ||
| required_capability: inline_stats_with_union_types_in_stub_relation | ||
|
|
||
| FROM employees, employees_incompatible | ||
| | KEEP emp_no, hire_date | ||
| | INLINE STATS c = count(emp_no::long) where hire_date > "1996-01-01" BY yr = DATE_TRUNC(1 year, hire_date) | ||
| | SORT yr DESC | ||
| | LIMIT 5 | ||
| | SORT yr DESC, hire_date DESC | ||
| | LIMIT 10 | ||
| ; | ||
|
|
||
| c:long | yr:date_nanos | ||
| 2 | 1999-01-01T00:00:00.000Z | ||
| 2 | 1997-01-01T00:00:00.000Z | ||
| 2 | 1996-01-01T00:00:00.000Z | ||
| 0 | 1995-01-01T00:00:00.000Z | ||
| 0 | 1994-01-01T00:00:00.000Z | ||
| emp_no:unsupported | hire_date:date_nanos |c:long | yr:date_nanos | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|0 |1995-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|0 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|0 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|0 |1995-01-01T00:00:00.000Z | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithEval-Ignore | ||
| required_capability: inline_stats | ||
| // https://github.com/elastic/elasticsearch/issues/133973 | ||
| // optimized incorrectly due to missing references [$$emp_no$converted_to$long{f$}# | ||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithEval | ||
| required_capability: inline_stats_with_union_types_in_stub_relation | ||
|
|
||
| FROM employees, employees_incompatible | ||
| | KEEP emp_no, hire_date | ||
| | EVAL yr = DATE_TRUNC(1 year, hire_date) | ||
| | INLINE STATS c = count(emp_no::long) BY yr | ||
| | SORT yr DESC | ||
| | LIMIT 5 | ||
| | SORT yr DESC, hire_date DESC | ||
| | LIMIT 10 | ||
| ; | ||
|
|
||
| c:long | yr:date_nanos | ||
| 2 | 1999-01-01T00:00:00.000Z | ||
| 2 | 1997-01-01T00:00:00.000Z | ||
| 2 | 1996-01-01T00:00:00.000Z | ||
| 10 | 1995-01-01T00:00:00.000Z | ||
| 8 | 1994-01-01T00:00:00.000Z | ||
| emp_no:unsupported | hire_date:date_nanos |c:long | yr:date_nanos | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithEvalWithFilter-Ignore | ||
| required_capability: inline_stats | ||
| // https://github.com/elastic/elasticsearch/issues/133973 | ||
| // optimized incorrectly due to missing references [$$emp_no$converted_to$long{f$}# | ||
| ImplicitCastingMultiTypedDateTruncInlinestats_ByWithEvalWithFilter | ||
| required_capability: inline_stats_with_union_types_in_stub_relation | ||
|
|
||
| FROM employees, employees_incompatible | ||
| | KEEP emp_no, hire_date | ||
| | EVAL yr = DATE_TRUNC(1 year, hire_date) | ||
| | INLINE STATS c = count(emp_no::long) where hire_date > "1991-01-01" BY yr | ||
| | SORT yr DESC | ||
| | LIMIT 5 | ||
| | SORT yr DESC, hire_date DESC | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I notice all these fixed tests involve a grouping key. Do we have tests for non-grouped inline stats? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I added a test here for this, and it worked. I'll push a commit for it, and if you feel that test is redundant, just revert the commit. |
||
| | LIMIT 10 | ||
| ; | ||
|
|
||
| c:long | yr:date_nanos | ||
| 2 | 1999-01-01T00:00:00.000Z | ||
| 2 | 1997-01-01T00:00:00.000Z | ||
| 2 | 1996-01-01T00:00:00.000Z | ||
| 10 | 1995-01-01T00:00:00.000Z | ||
| 8 | 1994-01-01T00:00:00.000Z | ||
| emp_no:unsupported | hire_date:date_nanos |c:long | yr:date_nanos | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1999-04-30T00:00:00.000Z|2 |1999-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1997-05-19T00:00:00.000Z|2 |1997-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1996-11-05T00:00:00.000Z|2 |1996-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-12-15T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| null |1995-08-22T00:00:00.000Z|10 |1995-01-01T00:00:00.000Z | ||
| ; | ||
|
|
||
| ImplicitCastingMultiTypedBucketDateNanosByYear | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have been nice to have an issue describing this more