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

[improvement](jdbc catalog) Disallow non-constant type conversion pushdown and implicit conversion pushdown #42102

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

zy-kkk
Copy link
Member

@zy-kkk zy-kkk commented Oct 18, 2024

Add a variable enable_jdbc_cast_predicate_push_down, the default value is false, which prohibits the pushdown of non-constant predicates with type conversion and all predicates with implicit conversion. This change can prevent the wrong predicates from being pushed down to the Jdbc data source, resulting in query data errors, because the predicates with cast were not correctly pushed down to the data source before.
If you find that the data is read correctly and the performance is better before this change, you can manually set this variable to true

| Expression                                          | Can Push Down |
|-----------------------------------------------------|---------------|
| column type equals const type                       | Yes           |
| column type equals cast const type                  | Yes           |
| cast column type equals const type                  | No            |
| cast column type equals cast const type             | No            |
| column type not equals column type                  | No            |
| column type not equals cast const type              | No            |
| cast column type not equals const type              | No            |
| cast column type not equals cast const type         | No            |

@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.

@zy-kkk
Copy link
Member Author

zy-kkk commented Oct 18, 2024

run buildall

morningman
morningman previously approved these changes Oct 21, 2024
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 Oct 21, 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.

@morningman
Copy link
Contributor

run buildall

@zy-kkk
Copy link
Member Author

zy-kkk commented Oct 22, 2024

run buildall

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Oct 22, 2024
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 Oct 22, 2024
Copy link
Contributor

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

@zy-kkk zy-kkk merged commit b7faf57 into apache:master Oct 22, 2024
26 of 28 checks passed
@zy-kkk zy-kkk deleted the disable_jdbc_cast_push branch October 22, 2024 06:23
zy-kkk added a commit to zy-kkk/doris that referenced this pull request Oct 22, 2024
…hdown and implicit conversion pushdown (apache#42102)

Add a variable `enable_jdbc_cast_predicate_push_down`, the default value
is false, which prohibits the pushdown of non-constant predicates with
type conversion and all predicates with implicit conversion. This change
can prevent the wrong predicates from being pushed down to the Jdbc data
source, resulting in query data errors, because the predicates with cast
were not correctly pushed down to the data source before.
If you find that the data is read correctly and the performance is
better before this change, you can manually set this variable to true

```
| Expression                                          | Can Push Down |
|-----------------------------------------------------|---------------|
| column type equals const type                       | Yes           |
| column type equals cast const type                  | Yes           |
| cast column type equals const type                  | No            |
| cast column type equals cast const type             | No            |
| column type not equals column type                  | No            |
| column type not equals cast const type              | No            |
| cast column type not equals const type              | No            |
| cast column type not equals cast const type         | No            |

```
morningman pushed a commit that referenced this pull request Oct 22, 2024
…n pushdown and implicit conversion pushdown (#42242)

pick (#42102)

Add a variable `enable_jdbc_cast_predicate_push_down`, the default value
is false, which prohibits the pushdown of non-constant predicates with
type conversion and all predicates with implicit conversion. This change
can prevent the wrong predicates from being pushed down to the Jdbc data
source, resulting in query data errors, because the predicates with cast
were not correctly pushed down to the data source before. If you find
that the data is read correctly and the performance is better before
this change, you can manually set this variable to true

```
| Expression                                          | Can Push Down |
|-----------------------------------------------------|---------------|
| column type equals const type                       | Yes           |
| column type equals cast const type                  | Yes           |
| cast column type equals const type                  | No            |
| cast column type equals cast const type             | No            |
| column type not equals column type                  | No            |
| column type not equals cast const type              | No            |
| cast column type not equals const type              | No            |
| cast column type not equals cast const type         | No            |

```
zy-kkk added a commit that referenced this pull request Nov 5, 2024
Related PR: #42102

Because we previously disabled the pushdown of cast, a test case error occurred when checking the pushdown of the clickhosue function. Because the column type is largeint, a cast will be generated when using from_unixtime, causing the function to fail to be pushed down. So we changed the column type to bigint.
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
Related PR: #42102

Because we previously disabled the pushdown of cast, a test case error occurred when checking the pushdown of the clickhosue function. Because the column type is largeint, a cast will be generated when using from_unixtime, causing the function to fail to be pushed down. So we changed the column type to bigint.
github-actions bot pushed a commit that referenced this pull request Nov 5, 2024
Related PR: #42102

Because we previously disabled the pushdown of cast, a test case error occurred when checking the pushdown of the clickhosue function. Because the column type is largeint, a cast will be generated when using from_unixtime, causing the function to fail to be pushed down. So we changed the column type to bigint.
morningman pushed a commit to morningman/doris that referenced this pull request Nov 6, 2024
…hdown and implicit conversion pushdown (apache#42102)

Add a variable `enable_jdbc_cast_predicate_push_down`, the default value
is false, which prohibits the pushdown of non-constant predicates with
type conversion and all predicates with implicit conversion. This change
can prevent the wrong predicates from being pushed down to the Jdbc data
source, resulting in query data errors, because the predicates with cast
were not correctly pushed down to the data source before.
If you find that the data is read correctly and the performance is
better before this change, you can manually set this variable to true

```
| Expression                                          | Can Push Down |
|-----------------------------------------------------|---------------|
| column type equals const type                       | Yes           |
| column type equals cast const type                  | Yes           |
| cast column type equals const type                  | No            |
| cast column type equals cast const type             | No            |
| column type not equals column type                  | No            |
| column type not equals cast const type              | No            |
| cast column type not equals const type              | No            |
| cast column type not equals cast const type         | No            |

```
morningman pushed a commit to morningman/doris that referenced this pull request Nov 6, 2024
…3196)

Related PR: apache#42102

Because we previously disabled the pushdown of cast, a test case error occurred when checking the pushdown of the clickhosue function. Because the column type is largeint, a cast will be generated when using from_unixtime, causing the function to fail to be pushed down. So we changed the column type to bigint.
morningman added a commit that referenced this pull request Nov 6, 2024
…hdown and implicit conversion pushdown #42102 (#43313)

cherry pick from #42102

Co-authored-by: zy-kkk <[email protected]>
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. dev/2.1.7-merged dev/3.0.3-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants