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

fix(core): disable pushdown filter to keep the casting for timestamp column #907

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

goldmedal
Copy link
Contributor

@goldmedal goldmedal commented Nov 13, 2024

Description

Sometimes, we will cast a timestamp column to a timestamp type because we must handle the DATETIME and TIMESTAMP for the BigQuery. However, push_down_filter will remove the casting because it can't differentiate DATETIME and TIMESTAMP in the DataFusion layer.

see the unit test for the details.
If applying push_down_filter, the result will be as below. However, it will fail if 出道時間 is DATETIME in BigQuery

SELECT 
  count(*) 
FROM 
  (
    SELECT 
      artist.cast_timestamp 
    FROM 
      (
        SELECT 
          CAST(
            artist."出道時間" AS TIMESTAMP WITH TIME ZONE
          ) AS cast_timestamp 
        FROM 
          artist 
        WHERE 
          artist."出道時間" > CAST(
            '2011-01-01 21:00:00' AS TIMESTAMP
          )
      ) AS artist
  ) AS artist

@github-actions github-actions bot added core rust Pull requests that update Rust code labels Nov 13, 2024
@goldmedal goldmedal marked this pull request as ready for review November 13, 2024 10:07
Copy link
Contributor

@grieve54706 grieve54706 left a comment

Choose a reason for hiding this comment

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

LGTM

@grieve54706 grieve54706 merged commit a01c4a8 into Canner:main Nov 14, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants