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

SQL: Don't serialize ZonedDateTime value directly in scripts #39877

Closed
costin opened this issue Mar 9, 2019 · 1 comment · Fixed by #39911
Closed

SQL: Don't serialize ZonedDateTime value directly in scripts #39877

costin opened this issue Mar 9, 2019 · 1 comment · Fixed by #39911

Comments

@costin
Copy link
Member

costin commented Mar 9, 2019

While Painless scripts do accept ZonedDateTime objects, serializing this into scripts (for example through the translate API) doesn't work since they get rendered as strings instead of actual objects.
As such, we should wrap them in dedicated methods to construct the runtime ZonedDateTime from primitives (such as strings).

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

costin added a commit to costin/elasticsearch that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix elastic#39877
costin added a commit to costin/elasticsearch that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix elastic#39877
costin added a commit that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix #39877
costin added a commit that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix #39877

(cherry picked from commit 4957cad)
costin added a commit that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix #39877

(cherry picked from commit 4957cad)
costin added a commit that referenced this issue Mar 11, 2019
Painless allows ZonedDateTime objects to be passed natively to scripts
which creates problematic translate queries as the ZonedDateTime is
passed as a string instead.
Wrap this with a dedicated method to perform the conversion.

Fix #39877

(cherry picked from commit 4957cad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants