-
Notifications
You must be signed in to change notification settings - Fork 148
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
[BugFix] support push down text field correctly. #3376
[BugFix] support push down text field correctly. #3376
Conversation
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
Signed-off-by: Heng Qian <[email protected]>
this.name = | ||
(ref == null || ref.getIndex() >= schema.size()) ? null : schema.get(ref.getIndex()); | ||
this.type = typeMapping.get(name); |
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.
NPE if typeMapping is null
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.
It won't return null for this map from the source, see
sql/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/OpenSearchIndex.java
Line 139 in 482c681
public Map<String, OpenSearchDataType> getFieldOpenSearchTypes() { |
return type; | ||
} | ||
|
||
boolean isTextType() { |
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.
how about change to notKeyword()
, isTextType
looks specific purpose
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.
I don't know if there is other case like Text type where we need to find keyword subfield.
There is similar specific method name in flint, https://github.com/opensearch-project/opensearch-spark/blob/c0c315f010fc1ef4606964e6b34a8ba6fb79949e/flint-spark-integration/src/main/scala/org/apache/spark/sql/flint/storage/FlintQueryCompiler.scala#L208, maybe just follow it.
Signed-off-by: Heng Qian <[email protected]>
fa63b23
into
opensearch-project:feature/calcite-engine
Description
When pushing filter with text field, I should construct QueryBuilder by using its subfield of keyword type; Otherwise, we cannot push down this field.
This PR includes change:
CalciteSortCommandIT
since we already addressed the issue of order perseverance for PPL in this PR: Fix execution errors caused by plan gap #3350../gradlew :integ-test:integTest --tests '*Calcite*IT'
succeed locally.Related Issues
Resolves #3334, #3373
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.