Added scan support for indexed fieldTypes - #21631
Conversation
07f0f37 to
011ab9d
Compare
|
❌ Gradle check result for 8beac7b: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 9303725: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
236b5e6 to
b34d75d
Compare
|
❌ Gradle check result for b34d75d: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❕ Gradle check result for b622b44: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21631 +/- ##
============================================
- Coverage 73.53% 73.47% -0.06%
+ Complexity 74752 74745 -7
============================================
Files 5985 5985
Lines 339180 339180
Branches 48900 48900
============================================
- Hits 249426 249223 -203
- Misses 69851 70131 +280
+ Partials 19903 19826 -77 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b622b44 to
602db6c
Compare
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
602db6c to
a1062c0
Compare
|
❌ Gradle check result for a1062c0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
* Added scan support for indexed fieldTypes Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated the javadocs Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Added IP and Binary predicate support Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * fixed type issues and ip project functions Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * remove local publish of sql repo Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * added todos Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * added half_float support Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> --------- Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> Signed-off-by: Khishorekumar BS <bkhishor@amazon.com>
* Added scan support for indexed fieldTypes Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Updated the javadocs Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * Added IP and Binary predicate support Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * fixed type issues and ip project functions Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * remove local publish of sql repo Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * added todos Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> * added half_float support Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com> --------- Signed-off-by: Vinay Krishna Pudyodu <vinkrish.neo@gmail.com>
Description
End-to-end support for
ipandbinaryfield types on the analytics-engine read path, plus the planner-side adaptations needed to compare aVARCHARliteral against the underlyingVARBINARYcolumns.Related change in opensearch-project/sql#5443, which extended the SQL plugin to emit a
BINARY(varchar)placeholder whenever a VARCHAR literal is compared to a VARBINARY column. This PR tells the analytics-engine planner and the DataFusion backend to consume that placeholder and execute against the parquet-backed columns end-to-end.Scope
Three layers, in the order the data flows through them:
Schema / scan —
ipandbinarymappings now bind to a VARBINARY Calcite column. The Rust executor's substrait consumer normalizes the parquetBinaryViewschema back toBinarybefore plan execution (schema_coerce::coerce_inferred_schema), since the DataFusion substrait consumer rejects theBinaryViewshape that the parquet reader infers. DataFusion'sDefaultPhysicalPlannerthen inserts the runtime cast between the coerced schema and the underlying parquetBinaryViewstorage.Predicates —
BinaryFunctionAdapterrewrites the SQL plugin's BINARY(varchar)placeholder into a typed VARBINARY literal whose bytes match the on-disk encoding (InetAddressPoint-style 16-byte IPv6-mapped forip, base64-decoded forbinary). Wired into the filter /IN/BETWEEN/cidrmatchpaths viaSTANDARD_FILTER_OPS,OpenSearchTypeFactory.leastRestrictive`, and the existing CIDR expansion.Project expressions —
BINARYis now inSTANDARD_PROJECT_OPS, so PPLeval if(col=lit, …),eval case(col=lit, …), andstats count(eval(col=lit))no longer get rejected at the project gate. To keep the planner's per-slot type-validity assertion happy, the adapter now wraps its literal inmakeAbstractCast(nullableVarbinary, …, false)—makeLiteral(ByteString, …)always reportsBINARY(N) NOT NULL, which mismatches the column slot'snullable VARBINARYtype and crashes the node insideLogicalProject.createwhen the literal lands in projection.unsigned_longOpenSearch's unsigned_long is a 64-bit unsigned integer. Substrait integers are signed-only and Calcite has no UNSIGNED BIGINT, so the type doesn't survive through the plan as-is.
is a bit-pattern relabel (zero copy, no value transform).
half_floatOpenSearch's half_float is a 16-bit IEEE float that lands as Arrow Float16 in parquet. Calcite has no fp16 type, and Substrait emits fp32, so the column doesn't bind end-to-end
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
opensearch-project/sql#5443