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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about day transform result type #10616

Closed
lurnagao-dahua opened this issue Jul 1, 2024 · 4 comments
Closed

Question about day transform result type #10616

lurnagao-dahua opened this issue Jul 1, 2024 · 4 comments
Labels
question Further information is requested

Comments

@lurnagao-dahua
Copy link
Contributor

lurnagao-dahua commented Jul 1, 2024

Apache Iceberg version

1.5.2 (latest release)

Query engine

None

Please describe the bug 馃悶

Hi!
The transform name 'day' result type is 'int' in spec.md and partition-transforms
and the code in Days.java is:
@Override public Type getResultType(Type sourceType) { return Types.DateType.get(); }
So may I ask if the document was written incorrectly and the actual return type is date?

@lurnagao-dahua lurnagao-dahua added the bug Something isn't working label Jul 1, 2024
@lurnagao-dahua lurnagao-dahua changed the title transform result type question Question about transform result type Jul 1, 2024
@ajantha-bhat
Copy link
Member

Good catch. I think the spec is correct.
Now if we change it the schema will be different from old client and new client (compatibility issue).

I think it has to be handled as per 2.0 release.
Let us wait for others opinion.

@Fokko
Copy link
Contributor

Fokko commented Jul 1, 2024

Hey @lurnagao-dahua Thanks for raising this, and @ajantha-bhat for jumping in here. This was discussed earlier in #10159 and points to a comment in #279 (comment).

Some historical context:

So the logical type is a date, but the physical type is still an int32, maybe we should make that more explicit? It seems to cause a lot of confusion. Looking forward to hearing what others think.

@Fokko Fokko changed the title Question about transform result type Question about day transform result type Jul 1, 2024
@ajantha-bhat
Copy link
Member

@Fokko: Thanks for pointing out the previous discussions. I was certain that important topics like this had been covered before, but I couldn't find the relevant threads. I appreciate you sharing them. It's great to know that you bumped into this during the Python implementation 馃憤

@ajantha-bhat ajantha-bhat added question Further information is requested and removed bug Something isn't working labels Jul 1, 2024
@lurnagao-dahua
Copy link
Contributor Author

Thank you everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants