Skip to content

Conversation

@wuyunfeng
Copy link
Member

@wuyunfeng wuyunfeng commented Dec 1, 2020

Proposed changes

Test Data:

CREATE EXTERNAL TABLE `bool_test` (
  `k1` int NULL COMMENT "",
  `k2` boolean NULL COMMENT ""
) ENGINE=ELASTICSEARCH
PROPERTIES (
"hosts" = "http://host:ip",
"user" = "root",
"password" = "root",
"index" = "bool_test",
"type" = "doc"
); 
MySQL [es]> select * from bool_test;
+------+------+
| k1   | k2   |
+------+------+
|    1 |    1 |
|    2 |    0 |
|    3 |    1 |
|    4 |    0 |
+------+------+

Process boolean field predicate be consistent with mysql grammar. such as:

MySQL [es]> select * from bool_test where k2 = true;
+------+------+
| k1   | k2   |
+------+------+
|    1 |    1 |
|    3 |    1 |
+------+------+
MySQL [es]> select * from bool_test where k2 = false;
+------+------+
| k1   | k2   |
+------+------+
|    2 |    0 |
|    4 |    0 |
+------+------+
MySQL [es]> select * from bool_test where k2 = 2;
Empty set (0.089 sec)
MySQL [es]> select * from bool_test where k2 = 0;
+------+------+
| k1   | k2   |
+------+------+
|    2 |    0 |
|    4 |    0 |
+------+------+

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • [] Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have create an issue on (Fix #ISSUE), and have described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] If this change need a document change, I have updated the document
  • Any dependent changes have been merged

Further comments

DOE user should know: This PR just process = predicate for boolean type column

@wuyunfeng wuyunfeng linked an issue Dec 1, 2020 that may be closed by this pull request
@wuyunfeng wuyunfeng self-assigned this Dec 1, 2020
@wuyunfeng wuyunfeng added the area/doris-on-es Issues or PRs related to Doris on ElasticSearch label Dec 1, 2020
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

@morningman morningman added the approved Indicates a PR has been approved by one committer. label Dec 1, 2020
@wuyunfeng wuyunfeng requested review from chaoyli and imay December 2, 2020 01:42
@wuyunfeng wuyunfeng merged commit af06adb into apache:master Dec 2, 2020
@wuyunfeng wuyunfeng deleted the fix-issue-4989 branch December 2, 2020 02:13
@yangzhg yangzhg mentioned this pull request Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. area/doris-on-es Issues or PRs related to Doris on ElasticSearch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doris On ES][Bug] Doris On Es Boolean Field Push Down error

4 participants