Skip to content

[PECOBLR-427] Add INTERVAL Type support#835

Merged
shivam2680 merged 13 commits into
mainfrom
shivam2680/interval-type
May 27, 2025
Merged

[PECOBLR-427] Add INTERVAL Type support#835
shivam2680 merged 13 commits into
mainfrom
shivam2680/interval-type

Conversation

@shivam2680

@shivam2680 shivam2680 commented May 21, 2025

Copy link
Copy Markdown
Collaborator

Description

Add INTERVAL data type support to OSS JDBC. Enables users to query on interval type columns on databricks. Supported in all execution modes.
SEA inline output will differ from others as the Conversion logic is as per JSON_ARRAY format instead of HIVE.
Legacy driver as well as thrift follows HIVE, so going with that.

Testing

  • Integration test (with all possible interval types)
  • Unit tests (incl edge cases)

Additional Notes to the Reviewer

@github-actions

Copy link
Copy Markdown

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

@shivam2680 shivam2680 marked this pull request as ready for review May 22, 2025 20:13
@shivam2680 shivam2680 changed the title Add INTERVAL Type support [PECOBLR-427] Add INTERVAL Type support May 22, 2025
timeZone = Optional.of(((TimeStampMicroTZVector) columnVector).getTimeZone());
}
return convertToTimestamp(object, timeZone);
case INTERVAL:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we don't need to handle in json?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

there's no json type in ColumnInfoTypeName

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's add a TODO and revisit this before SEA default rollout

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added todo and created tracking ticket
https://databricks.atlassian.net/browse/PECOBLR-442

Comment thread src/main/java/com/databricks/jdbc/api/impl/converters/IntervalConverter.java Outdated
private static final JdbcLogger LOGGER = JdbcLoggerFactory.getLogger(IntervalConverter.class);

// Arrow stores day‐time intervals in microseconds
private static final long MICROS_PER_SECOND = 1_000_000L;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where are you using this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

removed unused constants

@shivam2680 shivam2680 merged commit d0a6274 into databricks:main May 27, 2025
15 of 16 checks passed
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.

2 participants