Skip to content

#95: Add support for Parquet TIMESTAMP(NANOS, ...) values - #96

Merged
kaklakariada merged 13 commits into
mainfrom
kaklakariada/issue95
Aug 3, 2026
Merged

kaklakariada merged 13 commits into
mainfrom
kaklakariada/issue95

Conversation

@kaklakariada

Copy link
Copy Markdown
Collaborator

Closes #95

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30baeffe4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Not ready to approve

The user guide type-mapping table introduces a likely-invalid logical type label (timestamp_nanos) that should be corrected to accurately reflect Parquet’s TIMESTAMP logical type with NANOS unit.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Adds end-to-end support for reading Parquet INT64 columns annotated with the modern TIMESTAMP(NANOS, ...) logical type, materializing them as java.sql.Timestamp with full nanosecond precision (including pre-epoch values), and updates release/docs/tooling accordingly.

Changes:

  • Added a dedicated ParquetTimestampNanosConverter and factory dispatch for modern timestamp logical types (MILLIS/MICROS/NANOS).
  • Implemented DateTimeHelper.getTimestampFromNanos(...) with correct handling for negative epoch values and added unit/integration tests.
  • Updated documentation, release notes, dependencies, and GitHub workflows as part of the 2.1.0 release.
File summaries
File Description
src/main/java/com/exasol/parquetio/reader/converter/ParquetConverterFactory.java Detects modern timestamp logical type annotations and dispatches by TimeUnit including NANOS.
src/main/java/com/exasol/parquetio/reader/converter/ParquetTimestampNanosConverter.java New primitive converter that maps INT64 nanos-since-epoch to Timestamp.
src/main/java/com/exasol/parquetio/reader/converter/DateTimeHelper.java Adds nanos-to-Timestamp conversion utility with negative-value handling.
src/test/java/com/exasol/parquetio/reader/RowParquetReaderPrimitiveTypesTest.java Adds reader-level tests for modern timestamp millis/micros and nanos (including pre-epoch).
src/test/java/com/exasol/parquetio/reader/converter/DateTimeHelperTest.java Adds unit tests validating nanos conversion behavior.
src/test/java/com/exasol/parquetio/reader/converter/ParquetConverterFactoryTest.java Adds tests ensuring the factory selects the correct converter for modern timestamp units.
doc/system_requirements.md Adds a requirement documenting nanosecond timestamp reading behavior.
doc/design.md Adds design section describing nanosecond timestamp conversion behavior.
doc/user_guide.md Extends the type mapping table to include nanosecond timestamp support.
doc/changes/changes_2.1.0.md Adds 2.1.0 release notes entry for the feature and dependency updates.
doc/changes/changelog.md Links the new 2.1.0 changelog page.
pom.xml Bumps project version/parent version and updates Parquet + plugin versions.
pk_generated_parent.pom Updates plugin versions/configuration and adds SBOM-related plugins.
dependencies.md Regenerates dependency/license documentation to reflect updated plugins.
.github/zizmor.yml Updates zizmor ignore rationale comment.
.github/workflows/ci-build.yml Updates checkout/cache action versions, Java matrix (11/21), and reformats the artifact verification script.
.github/workflows/release.yml Updates checkout action version and Java matrix (11/21).
.github/workflows/dependencies_update.yml Updates checkout action version and Java matrix (11/21).
.github/workflows/dependencies_check.yml Updates checkout action version, Java matrix (11/21), and python-toolbox action version.
.github/workflows/broken_links_checker.yml Updates checkout action version.
Review details

Suppressed comments (1)

src/test/java/com/exasol/parquetio/reader/RowParquetReaderPrimitiveTypesTest.java:110

  • This test also uses the modern timestamp logical type annotation (via getModernTimestampSchema), so its name would be clearer if it followed the same "ModernTimestamp" naming pattern as the other modern timestamp tests.
    @Test
    void testReadsInt64TimestampNanosBeforeEpochAsTimestampValue() throws IOException {
        final MessageType schema = getModernTimestampSchema(TimeUnit.NANOS);
        try (ParquetWriter<Group> writer = getParquetWriter(schema, false)) {
            final SimpleGroup parquetRow = new SimpleGroup(schema);
  • Files reviewed: 20/20 changed files
  • Comments generated: 2
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread doc/user_guide.md Resolved
@kaklakariada
kaklakariada requested a review from Copilot August 3, 2026 12:15
@kaklakariada

Copy link
Copy Markdown
Collaborator Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Not ready to approve

The newly added local-epoch timestamp helpers currently use long multiplications that can overflow and silently yield incorrect timestamps for large values.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details

Suppressed comments (2)

src/main/java/com/exasol/parquetio/reader/converter/DateTimeHelper.java:102

  • getLocalTimestampFromMillis multiplies millis * 1_000_000, which can overflow long (e.g., for timestamps beyond ~2262-04-11) and silently produce wrong results. Using floorDiv/floorMod with plusSeconds/plusNanos avoids the overflow while keeping correct behavior for negative values.
    static Timestamp getLocalTimestampFromMillis(final long millis) {
        return getLocalTimestampFromNanos(millis * NANOS_PER_MILLIS);
    }

src/main/java/com/exasol/parquetio/reader/converter/DateTimeHelper.java:53

  • getLocalTimestampFromMicros multiplies microseconds * 1000, which can overflow long for large Parquet timestamp values and silently yield incorrect timestamps. Consider splitting into seconds + fractional part using Math.floorDiv/Math.floorMod to avoid overflow and handle negatives correctly.

This issue also appears on line 100 of the same file.

    static Timestamp getLocalTimestampFromMicros(final long microseconds) {
        return getLocalTimestampFromNanos(microseconds * NANOS_PER_MICROS);
    }
  • Files reviewed: 23/23 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 15368a381f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88a8a61bee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f24449ad59

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kaklakariada
kaklakariada enabled auto-merge (squash) August 3, 2026 13:14
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8c9171754

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kaklakariada
kaklakariada merged commit be04b8e into main Aug 3, 2026
9 checks passed
@kaklakariada
kaklakariada deleted the kaklakariada/issue95 branch August 3, 2026 14:22
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.

Support Parquet INT64 TIMESTAMP_NANOS values

3 participants