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] timestamp data type handling is inconsistent #3159

Closed
sablanscott opened this issue Nov 15, 2024 · 3 comments
Closed

[BUG] timestamp data type handling is inconsistent #3159

sablanscott opened this issue Nov 15, 2024 · 3 comments
Labels
bug Something isn't working v2.19.0 Issues targeting release v2.19.0

Comments

@sablanscott
Copy link

What is the bug?

When using SQL query, a timestamp field is handled differently if the SQL query has a join.

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

Data:
POST _bulk
{ "index": { "_index": "index_one"} }
{"stanza":4,"line_number":19,"line_text":"Presently my soul grew stronger; hesitating then no longer,"}
{ "index": { "_index": "index_one"} }
{"stanza":4,"line_number":20,"line_text":""Sir," said I, "or Madam, truly your forgiveness I implore;"}
{ "index": { "_index": "index_one"} }
{"stanza":11,"line_number":64,"line_text":"Followed fast and followed faster till his songs one burden bore—"}
{ "index": { "_index": "index_one"} }
{"stanza":11,"line_number":65,"line_text":"Till the dirges of his Hope that melancholy burden bore"}

POST _bulk
{ "index": { "_index": "index_two"} }
{ "log_timestamp": "2024-11-13T09:11:01.668-06:00","stanza": 11,"some_number": "some data 11"}
{ "index": { "_index": "index_two"} }
{ "log_timestamp": "2024-11-13T09:12:01.668-06:00","stanza": 4,"some_number": "some data 4 u"}

  1. Query index_two
    POST _plugins/_sql/
    {
    "query": "SELECT * from index_two"
    }
    The field log_timestamp schema is 'timestamp' but the timezone information is not displayed. (Image 1)

  2. run a join on the 2 indexes.
    POST _plugins/_sql/
    {
    "query": "SELECT two.log_timestamp, two.stanza, one.line_number, one.line_text FROM index_two two JOIN index_one one ON one.stanza = two.stanza"
    }
    The field log_timestamp schema is 'date' now and the returned value has the timezone information. (Image 2)

What is the expected behavior?
A TIMESTAMP data type should not change to date unless explicitly cast to one.
Also, the timezone information should always be included in the data.

What is your host/environment?

  • OS: Ubuntu 24.0.1 LTS
  • Version 2.1s
  • Plugins: SQL

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Image 1.

image

Image 2

image

Do you have any additional context?
Add any other context about the problem.

Issue was found using the JDBC driver (1.4.0.1). Issue was replicated using the Devtools on the dashboard.

@sablanscott sablanscott added bug Something isn't working untriaged labels Nov 15, 2024
@sablanscott
Copy link
Author

Version is 2.15 not 2.1s

@dblock dblock removed the untriaged label Dec 9, 2024
@dblock
Copy link
Member

dblock commented Dec 9, 2024

[Catch All Triage - 1, 2, 3, 4]

@Swiddis
Copy link
Collaborator

Swiddis commented Dec 17, 2024

Duplicate of #1545, and also reported in #3204. #3160 holds the fix, it's set to be shipped in 2.19.

@Swiddis Swiddis closed this as completed Dec 17, 2024
@Swiddis Swiddis added the v2.19.0 Issues targeting release v2.19.0 label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.19.0 Issues targeting release v2.19.0
Projects
None yet
Development

No branches or pull requests

3 participants