Skip to content
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

[fix](ES Catalog)Only like on keyword can be applied to wildcard query #41176

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

qidaye
Copy link
Contributor

@qidaye qidaye commented Sep 23, 2024

Proposed changes

We map text and keyword both to string type in Doris. When enable like_push_down, we translate like to wildcard query in ES, which will lead unexpected result in text field. We should stick to keyword with wildcard query.

  1. Add column2typeMap in EsTable to save the mapping of column_name to ES field data type.
  2. Add new class EsSchemaCacheValue to get schema and column to type map
  3. Init column2typeMap when cache init and build query process of ES external table
  4. Support LIKE functionCallExpr for Nereids planner.
  5. Add end to end like predicate test cases and UTs

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@qidaye
Copy link
Contributor Author

qidaye commented Sep 23, 2024

run buildall

Copy link
Contributor

@xiaokang xiaokang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a end to end testcase for text_field LIKE xxx ?

@qidaye
Copy link
Contributor Author

qidaye commented Sep 25, 2024

run buildall

xiaokang
xiaokang previously approved these changes Sep 25, 2024
Copy link
Contributor

@xiaokang xiaokang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 25, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Sep 26, 2024
@qidaye
Copy link
Contributor Author

qidaye commented Sep 26, 2024

run buildall

We map `text` and `keyword` both to `string` type in Doris.
When enable `like_push_down`, we translate like to wildcard query in ES, which will lead unexpected result in `text` field.
We should stick to `keyword` with wildcard query.
1. Add `column2typeMap` in `EsTable` to save the mapping of column_name to ES field data type.
2. Add new class `EsSchemaCacheValue` to get schema and column to type map
2. Init `column2typeMap` when cache init and build query process of ES external table
2. Add end to end test case for like.
@qidaye
Copy link
Contributor Author

qidaye commented Oct 8, 2024

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants