Skip to content

Maintain time zone in ScalarValue::new_list#7899

Merged
crepererum merged 1 commit intomainfrom
maintain_time_zone
Oct 23, 2023
Merged

Maintain time zone in ScalarValue::new_list#7899
crepererum merged 1 commit intomainfrom
maintain_time_zone

Conversation

@Dandandan
Copy link
Copy Markdown
Contributor

@Dandandan Dandandan commented Oct 21, 2023

Which issue does this PR close?

Closes #7900

Rationale for this change

This causes some bugs in Coralogix for count distinct (I couldn't reproduce with sql e2e tests in DataFusion)

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@Dandandan Dandandan changed the title Maintain time_zone in ScalarValue::new_list Maintain time zone in ScalarValue::new_list Oct 22, 2023
Copy link
Copy Markdown
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

LGTM!

let s: &'static str = "UTC";
let values = vec![ScalarValue::TimestampMillisecond(Some(1), Some(s.into()))];
let arr = ScalarValue::new_list(
&values,
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.

Does this fail if the timezone provided by one of the values is different than the one provided by the datatype argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the test fails (and test as is fails on master).

@crepererum crepererum merged commit f72ee5e into main Oct 23, 2023
@alamb alamb deleted the maintain_time_zone branch October 23, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScalarValue::new_list loses timestamp timezone info

4 participants