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

Snowflake always returns times truncated second precision, we should fix this for tests #41866

Closed
camsaul opened this issue Apr 26, 2024 · 0 comments · Fixed by #41864
Closed
Assignees
Labels
.Backend .CI & Tests Database/Snowflake Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Querying/Processor .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Milestone

Comments

@camsaul
Copy link
Member

camsaul commented Apr 26, 2024

Mostly important for tests, since all of the other DBs use millisecond precision meaning Snowflake results are different for no reason.

The default output format is HH24:MI:SS apparently

https://docs.snowflake.com/en/sql-reference/parameters#time-output-format

(mt/test-driver :snowflake
  (mt/with-temporary-setting-values [report-timezone "US/Pacific"]
    (mt/dataset attempted-murders
      (mt/rows
       (qp/process-query
        (-> (mt/native-query
              {:query "SELECT time '00:23:18.331', '00:23:18.331'::time(9), time_from_parts(0, 23, 18, 123456789)"})
            (assoc-in [:middleware :format-rows?] false)))))))
;; => [[#t "00:23:18" #t "00:23:18" #t "00:23:18"]]
@camsaul camsaul added Type:Bug Product defects Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Querying/Processor .CI & Tests Database/Snowflake .Backend .Team/QueryProcessor :hammer_and_wrench: labels Apr 26, 2024
@camsaul camsaul self-assigned this Apr 26, 2024
@camsaul camsaul changed the title Snowflake always returns times with only second precision Snowflake always returns times truncated second precision (fix for tests) Apr 26, 2024
@camsaul camsaul changed the title Snowflake always returns times truncated second precision (fix for tests) Snowflake always returns times truncated second precision, we should fix this for tests Apr 26, 2024
@camsaul camsaul added this to the 0.49.8 milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend .CI & Tests Database/Snowflake Priority:P3 Cosmetic bugs, minor bugs with a clear workaround Querying/Processor .Team/QueryProcessor :hammer_and_wrench: Type:Bug Product defects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant