Skip to content

Commit 8dfdf1a

Browse files
Fix UT failures related to trying to get the datatype on unresolved attribute
1 parent b3ee3a0 commit 8dfdf1a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/PostOptimizationPhasePlanVerifier.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public Failures verify(P optimizedPlan, boolean skipRemoteEnrichVerification, Li
5252
abstract void checkPlanConsistency(P optimizedPlan, Failures failures, Failures depFailures);
5353

5454
private static void verifyOutputNotChanged(QueryPlan<?> optimizedPlan, List<Attribute> expectedOutputAttributes, Failures failures) {
55+
// disable this check if there are other failures already
56+
// it is possible that some of the attributes are not resolved yet and that is reflected in the failures
57+
// we cannot get the datatype on an unresolved attribute
58+
// if we try it, it causes an exception and the exception hides the more detailed error message
59+
if (failures.hasFailures()) {
60+
return;
61+
}
5562
if (dataTypeEquals(expectedOutputAttributes, optimizedPlan.output()) == false) {
5663
// If the output level is empty we add a column called ProjectAwayColumns.ALL_FIELDS_PROJECTED
5764
// We will ignore such cases for output verification

0 commit comments

Comments
 (0)