[BugFix] Add regression tests for disabled object field queries (#4904)#5308
[BugFix] Add regression tests for disabled object field queries (#4904)#5308qianheng-aws wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
…search-project#4904) The bug where PPL queries failed when field mapping has enabled:false has been resolved by prior improvements to MAP path resolution and script pushdown handling. This commit adds YAML REST regression tests to prevent the issue from recurring. Signed-off-by: Heng Qian <qianheng@amazon.com>
Decision LogRoot Cause: When a field mapping has Approach: Investigation confirmed the bug is no longer reproducible on Alternatives Rejected: Writing a dedicated Calcite PPL unit test was considered but rejected because the SCOTT test schema doesn't support MAP types from Pitfalls: The v2 (non-Calcite) engine also handles this case without error — it resolves Things to Watch: The Schema-on-Read RFC (#4984) proposes a more comprehensive solution for schema-on-read data sources. When implemented, it may change how disabled object fields are resolved, and these regression tests should continue to pass. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
Issue #4904 reported that PPL queries failed when a field mapping has
enabled:false. The bug manifested as aRuntimeException: cannot translate call AS($t2, $t3)when the Calcite engine tried to push down a filter on a disabled object's sub-field as a script.Investigation shows this issue has been resolved on
mainby the cumulative effect of several improvements:top/rare,join,lookupandstreamstats#5206)The Calcite engine now correctly resolves sub-field access on disabled objects (typed as MAP) using
ITEM(field, key)expressions, and the filter pushdown handles these expressions without error.This PR adds YAML REST regression tests to prevent the issue from recurring:
whereclause filtering on a disabled object sub-fieldfieldsandsortcommands on disabled object sub-fields with value verificationRelated Issues
Resolves #4904
Check List
-s)spotlessCheckpassed