Skip to content

Conversation

@github-actions
Copy link
Contributor

Cherry-picked from #45104

…ins (#45104)

### What problem does this PR solve?

Related PR: #43255 

Problem Summary:
Should ignore null values when the literals of in_predicate contains
null value, like `in (1, null)`
For example, init table in hive:
```sql
CREATE TABLE sample_orc_table (
    id INT,
    name STRING,
    age INT
)
STORED AS ORC;
INSERT INTO TABLE sample_orc_table VALUES
    (1, 'Alice', 25),
    (2, NULL, NULL); 
```
select result in Doris should be:
```sql
mysql> select * from sample_orc_table where age in (null,25);
+------+-------+------+
| id   | name  | age  |
+------+-------+------+
|    1 | Alice |   25 |
+------+-------+------+
1 row in set (0.30 sec)

mysql> select * from sample_orc_table where age in (25);
+------+-------+------+
| id   | name  | age  |
+------+-------+------+
|    1 | Alice |   25 |
+------+-------+------+
1 row in set (0.27 sec)

mysql> select * from sample_orc_table where age in (null);
Empty set (0.01 sec)

mysql> select * from sample_orc_table where age is null;
+------+------+------+
| id   | name | age  |
+------+------+------+
|    2 | NULL | NULL |
+------+------+------+
1 row in set (0.11 sec)
```
@hello-stephen
Copy link
Contributor

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring reopened this Dec 18, 2024
@hello-stephen
Copy link
Contributor

run buildall

@github-actions
Copy link
Contributor Author

clang-tidy review says "All clean, LGTM! 👍"

@yiguolei yiguolei merged commit 55a51dc into branch-3.0 Dec 19, 2024
22 of 24 checks passed
@github-actions github-actions bot deleted the auto-pick-45104-branch-3.0 branch December 19, 2024 08:46
morningman added a commit to morningman/doris that referenced this pull request Feb 8, 2025
morningman added a commit that referenced this pull request Feb 9, 2025
revert:
branch-3.0: [fix](orc) ignore null values when the literals of
in_predicate contains #45104 (#45586)
[fix](orc) check all the cases before build_search_argument (#44615)
(#44802)
branch-3.0: [enhance](orc) Optimize ORC Predicate Pushdown for
OR-connected Predicate #43255 (#44436)

re-pick:
branch-3.0: [Fix](ORC) Not push down fixed char type in orc reader
#45484 (#45525)

---------

Co-authored-by: Socrates <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants