Skip to content

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

Merged
zy-kkk merged 3 commits into
apache:masterfrom
zy-kkk:disable_jdbc_cast_push
Oct 22, 2024
Merged

[improvement](jdbc catalog) Disallow non-constant type conversion pushdown and implicit conversion pushdown#42102
zy-kkk merged 3 commits into
apache:masterfrom
zy-kkk:disable_jdbc_cast_push

Conversation

@zy-kkk

@zy-kkkzy-kkk commented Oct 18, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown

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
Copy Markdown
MemberAuthor

run buildall

Comment threadfe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java Outdated
morningman
morningman previously approved these changes Oct 21, 2024

@morningmanmorningman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Oct 21, 2024
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@morningman

Copy link
Copy Markdown
Contributor

run buildall

@zy-kkk

Copy link
Copy Markdown
MemberAuthor

run buildall

@github-actionsgithub-actionsBot removed the approved Indicates a PR has been approved by one committer. label Oct 22, 2024

@morningmanmorningman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Oct 22, 2024
@github-actions

Copy link
Copy Markdown
Contributor

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

@zy-kkk
zy-kkk merged commit b7faf57 into apache:masterOct 22, 2024
@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-actionsBot 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-actionsBot 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 <zhongyk10@gmail.com>
morningman pushed a commit to morningman/doris that referenced this pull request Nov 18, 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.
@gavinchougavinchou mentioned this pull request Nov 26, 2024
morningman pushed a commit that referenced this pull request Nov 28, 2024
…t true (#44548)
### What problem does this PR solve?
Related PR: #42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
github-actionsBot pushed a commit that referenced this pull request Nov 28, 2024
…t true (#44548)
### What problem does this PR solve?
Related PR: #42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
github-actionsBot pushed a commit that referenced this pull request Nov 28, 2024
…t true (#44548)
### What problem does this PR solve?
Related PR: #42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
yiguolei pushed a commit that referenced this pull request Nov 29, 2024
…t true (#44548)
### What problem does this PR solve?
Related PR: #42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
yiguolei pushed a commit that referenced this pull request Dec 1, 2024
…t true (#44548)
### What problem does this PR solve?
Related PR: #42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…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 |
```
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…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.
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…t true (apache#44548)
### What problem does this PR solve?
Related PR: apache#42102
Problem Summary:
We found that after disabling pushdown of predicates with implicit
casts, some users experienced slower queries, so we temporarily changed
this parameter back to the default behavior.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.dev/2.1.7-mergeddev/3.0.3-mergedkind/behavior-changedreviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@zy-kkk@doris-robot@morningman@CalvinKirs