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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] JDBC Driver doesn't return TIMESTAMP fractional seconds #924

Closed
kylepbit opened this issue Oct 17, 2022 · 4 comments
Closed

[BUG] JDBC Driver doesn't return TIMESTAMP fractional seconds #924

kylepbit opened this issue Oct 17, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@kylepbit
Copy link
Contributor

What is the bug?
Timestamps with fractional seconds have the fractions stripped through the JDBC driver.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Load data into a timestamp index with fractional seconds
  2. Connect using the JDBC driver
  3. Issue a SELECT * query on the table
  4. Notice no fractional seconds for any values

What is the expected behavior?
Fractional seconds match the inserted values

What is your host/environment?

  • OS: macOS
  • Version JDBC 1.1.0.1
  • Plugins
@kylepbit kylepbit added bug Something isn't working untriaged labels Oct 17, 2022
@Yury-Fridlyand
Copy link
Collaborator

Test data:
test_data.zip

@MaxKsyunz
Copy link
Collaborator

MaxKsyunz commented Oct 18, 2022

The problem is here.
image

This is the definition of DATE_TIME_FORMATTER
image

The correct solution should use the formatter specified in the mapping for the field or whatever is set as the default formatter in OpenSearch[*].

Here are the docs for date field formatters.

[*] I thought I read somewhere it's a setting, but I can't find it. Default formatters used by OpenSearch are here.

@MaxKsyunz
Copy link
Collaborator

constructTimestamp should be able to use DateFormatters.forPattern to get date formatter for one of the pre-defined formats.

@kylepbit
Copy link
Contributor Author

I believe this was actually a red herring - it appears to have invoked the v1 SQLEngine which doesn't have timestamp, and thus couldn't return the precision. It's now working correctly after some other changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants