Skip to content

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
@github-actions
Copy link
Contributor

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

@github-actions
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

@qidaye qidaye force-pushed the fix_es_catalog_like branch from b20d14d to 97e5c2f Compare October 8, 2024 02:46
@qidaye
Copy link
Contributor Author

qidaye commented Oct 8, 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 qidaye force-pushed the fix_es_catalog_like branch from 97e5c2f to e7dc509 Compare November 5, 2024 07:18
@qidaye
Copy link
Contributor Author

qidaye commented Nov 5, 2024

run buildall

Copy link
Contributor

@morningman morningman 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 Nov 6, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2024

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

Copy link
Member

@airborne12 airborne12 left a comment

Choose a reason for hiding this comment

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

LGTM

@airborne12 airborne12 merged commit bb5533d into apache:master Nov 7, 2024
github-actions bot pushed a commit that referenced this pull request Nov 7, 2024
#41176)

## 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
github-actions bot pushed a commit that referenced this pull request Nov 7, 2024
#41176)

## 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
@qidaye qidaye deleted the fix_es_catalog_like branch November 7, 2024 09:10
qidaye added a commit to qidaye/incubator-doris that referenced this pull request Nov 7, 2024
apache#41176)

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
airborne12 pushed a commit that referenced this pull request Nov 7, 2024
…ildcard query (#43400)

Cherry-picked from #41176

Co-authored-by: qiye <jianliang5669@gmail.com>
airborne12 added a commit that referenced this pull request Nov 8, 2024
…ildcard query (#43399)

Cherry-picked from #41176

Co-authored-by: qiye <jianliang5669@gmail.com>
Co-authored-by: airborne12 <airborne08@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants