Skip to content

[fix](nereids) Convert to datetime when binary expr's left is date and right is int type#15615

Merged
morrySnow merged 1 commit intoapache:masterfrom
Kikyou1997:fix/part_prune
Jan 6, 2023
Merged

[fix](nereids) Convert to datetime when binary expr's left is date and right is int type#15615
morrySnow merged 1 commit intoapache:masterfrom
Kikyou1997:fix/part_prune

Conversation

@Kikyou1997
Copy link
Contributor

@Kikyou1997 Kikyou1997 commented Jan 4, 2023

Proposed changes

Issue Number: close #xxx

Problem summary

In the below case, expression date > 20200101 should implicit cast date both side to datetime instead of bigint

        CREATE TABLE `part_by_date`
        (
            `date`                       date         NOT NULL COMMENT '',
            `id`                      int(11) NOT NULL COMMENT ''
        ) ENGINE=OLAP
        UNIQUE KEY(`date`, `id`)
        PARTITION BY RANGE(`date`) 
        (PARTITION p201912 VALUES [('0000-01-01'), ('2020-01-01')),
        PARTITION p202001 VALUES [('2020-01-01'), ('2020-02-01')))
        DISTRIBUTED BY HASH(`id`) BUCKETS 3
        PROPERTIES (
        "replication_allocation" = "tag.location.default: 1"
        );



        INSERT INTO  part_by_date VALUES('0001-02-01', 1),('2020-01-15', 2);


        SELECT
            id
        FROM
           part_by_date
        WHERE date > 20200101;

}

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions github-actions bot added area/nereids area/planner Issues or PRs related to the query planner kind/test labels Jan 4, 2023
@hello-stephen
Copy link
Contributor

hello-stephen commented Jan 4, 2023

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 35.96 seconds
load time: 652 seconds
storage size: 17123730776 Bytes
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230105191658_clickbench_pr_74484.html

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jan 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

PR approved by anyone and no changes requested.

@morrySnow morrySnow merged commit 7f84db3 into apache:master Jan 6, 2023
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/nereids area/planner Issues or PRs related to the query planner kind/test reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants