Skip to content

Commit

Permalink
Skip LOOKUP/INLINESTATS cases unless on snapshot (elastic#111755)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-spies authored Aug 9, 2024
1 parent 4694a44 commit f0d06ee
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ tests:
- class: org.elasticsearch.tdigest.ComparisonTests
method: testSparseGaussianDistribution
issue: https://github.com/elastic/elasticsearch/issues/111721
- class: org.elasticsearch.xpack.esql.analysis.VerifierTests
method: testUnsupportedAndMultiTypedFields
issue: https://github.com/elastic/elasticsearch/issues/111753

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,17 @@ public void testUnsupportedAndMultiTypedFields() {
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | stats count(1) by multi_typed", analyzer)
);
assertEquals(
"1:38: Cannot use field [unsupported] with unsupported type [flattened]",
error("from test* | inlinestats count(1) by unsupported", analyzer)
);
assertEquals(
"1:38: Cannot use field [multi_typed] due to ambiguities being mapped as [2] incompatible types:"
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | inlinestats count(1) by multi_typed", analyzer)
);
if (EsqlCapabilities.Cap.INLINESTATS.isEnabled()) {
assertEquals(
"1:38: Cannot use field [unsupported] with unsupported type [flattened]",
error("from test* | inlinestats count(1) by unsupported", analyzer)
);
assertEquals(
"1:38: Cannot use field [multi_typed] due to ambiguities being mapped as [2] incompatible types:"
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | inlinestats count(1) by multi_typed", analyzer)
);
}

assertEquals(
"1:27: Cannot use field [unsupported] with unsupported type [flattened]",
Expand All @@ -157,15 +159,17 @@ public void testUnsupportedAndMultiTypedFields() {
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | stats values(multi_typed)", analyzer)
);
assertEquals(
"1:33: Cannot use field [unsupported] with unsupported type [flattened]",
error("from test* | inlinestats values(unsupported)", analyzer)
);
assertEquals(
"1:33: Cannot use field [multi_typed] due to ambiguities being mapped as [2] incompatible types:"
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | inlinestats values(multi_typed)", analyzer)
);
if (EsqlCapabilities.Cap.INLINESTATS.isEnabled()) {
assertEquals(
"1:33: Cannot use field [unsupported] with unsupported type [flattened]",
error("from test* | inlinestats values(unsupported)", analyzer)
);
assertEquals(
"1:33: Cannot use field [multi_typed] due to ambiguities being mapped as [2] incompatible types:"
+ " [ip] in [test1, test2], [keyword] in [test3]",
error("from test* | inlinestats values(multi_typed)", analyzer)
);
}

assertEquals(
"1:27: Cannot use field [unsupported] with unsupported type [flattened]",
Expand All @@ -177,16 +181,18 @@ public void testUnsupportedAndMultiTypedFields() {
error("from test* | stats values(multi_typed)", analyzer)
);

// LOOKUP with unsupported type
assertEquals(
"1:41: column type mismatch, table column was [integer] and original column was [unsupported]",
error("from test* | lookup int_number_names on int", analyzer)
);
// LOOKUP with multi-typed field
assertEquals(
"1:44: column type mismatch, table column was [double] and original column was [unsupported]",
error("from test* | lookup double_number_names on double", analyzer)
);
if (EsqlCapabilities.Cap.LOOKUP_V4.isEnabled()) {
// LOOKUP with unsupported type
assertEquals(
"1:41: column type mismatch, table column was [integer] and original column was [unsupported]",
error("from test* | lookup int_number_names on int", analyzer)
);
// LOOKUP with multi-typed field
assertEquals(
"1:44: column type mismatch, table column was [double] and original column was [unsupported]",
error("from test* | lookup double_number_names on double", analyzer)
);
}

assertEquals(
"1:24: Cannot use field [unsupported] with unsupported type [flattened]",
Expand Down

0 comments on commit f0d06ee

Please sign in to comment.