Skip to content

Conversation

@matthias-Q
Copy link
Contributor

Rationale for this change

Are these changes tested?

yes

Are there any user-facing changes?

no

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

Great catch! I have a question on time-millis

Comment on lines +71 to +73
("time-millis", "int"): TimeType(),
("time-micros", "long"): TimeType(),
("timestamp-millis", "int"): TimestampType(),
("timestamp-millis", "long"): TimestampType(),
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch! heres the corresponding type conversion for timestamp-millis in java https://github.com/apache/iceberg/blob/d3d5662aee19dd1799fd12740c64eadcb7f8da8b/core/src/main/java/org/apache/iceberg/avro/GenericAvroReader.java#L184-L187

I see time-micros but I dont see time-millis in here though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. I was just looking into the Avro Spec for logicalTypes and not in the iceberg Java Code.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was intentional since Iceberg does not support millis, just micros, and nanos in V3+

Comment on lines +345 to +348
def test_convert_time_millis_type() -> None:
avro_logical_type = {"type": "int", "logicalType": "time-millis"}
actual = AvroSchemaConversion()._convert_logical_type(avro_logical_type)
assert actual == TimeType()
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if theres a better way to test these type conversions..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could put them in 1 test and parameterize it with pytest

@kevinjqliu
Copy link
Contributor

looks like the linter failed, could you run make lint?

ruff (legacy alias)......................................................Failed
- hook id: ruff
- exit code: 1
- files were modified by this hook

Found 1 error (1 fixed, 0 remaining).

@matthias-Q
Copy link
Contributor Author

Closing this because of the discussion in #2173 and the feature request #2239

@matthias-Q matthias-Q closed this Jul 23, 2025
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.

3 participants