-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
API: implement types timestamp_ns and timestamptz_ns #9008
Conversation
Do these need to be addressed in this PR? TestSpark3Util > testDescribeSortOrder FAILED
org.junit.ComparisonFailure: Sort order isn't correct. expected:<[hours(time) DESC NULLS FIRST]> but was:<[]>
at org.junit.Assert.assertEquals(Assert.java:117)
at org.apache.iceberg.spark.TestSpark3Util.testDescribeSortOrder(TestSpark3Util.java:84)
TestFilteredScan > [format = parquet, vectorized = false, planningMode = LOCAL] > testHourPartitionedTimestampFilters[format = parquet, vectorized = false, planningMode = LOCAL] FAILED
java.lang.AssertionError: Primitive value should be equal to expected expected:<8> but was:<5>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:120)
at org.apache.iceberg.spark.data.GenericsHelpers.assertEqualsSafe(GenericsHelpers.java:119)
at org.apache.iceberg.spark.data.GenericsHelpers.assertEqualsSafe(GenericsHelpers.java:68)
at org.apache.iceberg.spark.source.TestFilteredScan.assertEqualsSafe(TestFilteredScan.java:573)
at org.apache.iceberg.spark.source.TestFilteredScan.testHourPartitionedTimestampFilters(TestFilteredScan.java:374) |
@jacobmarble are you sure those failures aren't caused by the changes introduced in this PR? |
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/apache/iceberg/expressions/TestStringLiteralConversions.java
Outdated
Show resolved
Hide resolved
api/src/test/java/org/apache/iceberg/types/TestConversions.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi all!
I've recently joined Jacob's team at Influx and will be taking over this pull request. I've started by addressing the test failures and asking some questions about the review comments. I'd like to address everything this week.
Thanks!
547aadd
to
f3dad15
Compare
https://github.com/apache/iceberg/actions/runs/7717197684/job/21172136322?pr=9008
|
I wonder why not using something similar to what we have for For backward compatible, we can keep Just wondering 😄 |
b1e18f1
to
d8688f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take another look @rdblue -- thanks!
api/src/main/java/org/apache/iceberg/expressions/ExpressionUtil.java
Outdated
Show resolved
Hide resolved
d8688f2
to
0edf1d8
Compare
Helps apache#8657 This change adds field `TimestampType.Unit unit` to `TimestampType`, such that `TimestampType` now represents four specified types: - `timestamp` (existing) - `timestamptz` (existing) - `timestamp_ns` (new apache#8683) - `timestamptz_ns` (new apache#8683) Note that TimestampType.with[out]Zone() are marked as deprecated in this change. In future PRs, I'll remove usage of these static methods.
0edf1d8
to
0e098f0
Compare
Review fixes for timestamp_ns API changes
Thanks for the direct feedback and added commits @rdblue! |
@jacobmarble looks like we need to run spotless. |
@rdblue Done. |
I opened jacobmarble#2 to fix the remaining issue, which is that there was no check that prevented the new type from being used in v1 or v2 tables. |
Prevent creating table metadata with nanosecond timestamps before v3
*/ | ||
public static void checkCompatibility(Schema schema, int formatVersion) { | ||
// check the type in each field | ||
for (NestedField field : schema.lazyIdToField().values()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Now that I'm thinking about this more, we may want to accumulate a full set of problems and then show them in one message. That can be done as a follow-up though.
Thanks, @jacobmarble and @epgif! |
Thank you for helping us get across the finish line @rdblue! |
* main: (208 commits) Docs: Fix Flink 1.20 support versions (apache#11065) Flink: Fix compile warning (apache#11072) Docs: Initial committer guidelines and requirements for merging (apache#10780) Core: Refactor ZOrderByteUtils (apache#10624) API: implement types timestamp_ns and timestamptz_ns (apache#9008) Build: Bump com.google.errorprone:error_prone_annotations (apache#11055) Build: Bump mkdocs-material from 9.5.33 to 9.5.34 (apache#11062) Flink: Backport PR apache#10526 to v1.18 and v1.20 (apache#11018) Kafka Connect: Disable publish tasks in runtime project (apache#11032) Flink: add unit tests for range distribution on bucket partition column (apache#11033) Spark 3.5: Use FileGenerationUtil in PlanningBenchmark (apache#11027) Core: Add benchmark for appending files (apache#11029) Build: Ignore benchmark output folders across all modules (apache#11030) Spec: Add RemovePartitionSpecsUpdate REST update type (apache#10846) Docs: bump latest version to 1.6.1 (apache#11036) OpenAPI, Build: Apply spotless to testFixtures source code (apache#11024) Core: Generate realistic bounds in benchmarks (apache#11022) Add REST Compatibility Kit (apache#10908) Flink: backport PR apache#10832 of inferring parallelism in FLIP-27 source (apache#11009) Docs: Add Druid docs url to sidebar (apache#10997) ...
Closes #8657
Closes #10775
This change adds field
ChronoUnit unit
toTimestampType
, such thatTimestampType
now represents four specified types:timestamp
(existing)timestamptz
(existing)timestamp_ns
(new Spec: add nanosecond timestamp types #8683)timestamptz_ns
(new Spec: add nanosecond timestamp types #8683)Note that
TimestampType.with[out]Zone()
are marked as deprecated in this change. In future PRs, I'll remove usage of these static methods.