Skip to content

Fix partition transform align with java - #3022

Open
Kurtiscwright wants to merge 2 commits into
apache:mainfrom
Kurtiscwright:fix-partition-transform-align-with-java
Open

Fix partition transform align with java#3022
Kurtiscwright wants to merge 2 commits into
apache:mainfrom
Kurtiscwright:fix-partition-transform-align-with-java

Conversation

@Kurtiscwright

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

Moved transform to using from EPOCH time on Year, Month, and Hour (Day already aligns with Java).

Are these changes tested?

Added new unit tests to validate these changes

AI Disclosure

Use Claude to write unit tests and comments

@blackmwk blackmwk 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.

Thanks @Kurtiscwright for this pr!

// to format the ordinal. Day needs no arm: its result type is `date`, so
// the datum already renders as a calendar date. Any literal that is not an
// `int` falls through to the existing behaviour.
if let Literal::Primitive(PrimitiveLiteral::Int(ordinal)) = value {

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.

I prefer to move this under line 181 so that it's more consistent.

}

#[test]
fn test_human_year() {

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.

I'm not a big fan of adding tests for private fn, I prefer to test against pub fun, e.g. to_human_string. Ideally, we could add doc to to_human_string which includes runnable codes to demonstrate the result.

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.

Align Iceberg Rust Partition Date Time Transform to Iceberg Java's

2 participants