Skip to content

SQL: values in datetime script aggs should be treated as long#39773

Merged
imotov merged 1 commit intoelastic:masterfrom
imotov:issue-37042-date-in-key-extractor
Mar 8, 2019
Merged

SQL: values in datetime script aggs should be treated as long#39773
imotov merged 1 commit intoelastic:masterfrom
imotov:issue-37042-date-in-key-extractor

Conversation

@imotov
Copy link
Copy Markdown
Contributor

@imotov imotov commented Mar 6, 2019

When a query is translated into script terms agg where key has a date
type, it should generate a terms agg with value_type long instead of
date, otherwise the key gets formatted as a string, which confuses
hit extractor.

Fixes #37042

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search

When a query is translated into script terms agg where key has a date
type, it should generate a terms agg with value_type long instead of
date, otherwise the key gets formatted as a string, which confuses
hit extractor.

Fixes elastic#37042
@imotov imotov force-pushed the issue-37042-date-in-key-extractor branch from 014ccd9 to 1721716 Compare March 7, 2019 14:42
Copy link
Copy Markdown
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

LGTM, good catch!

@costin costin self-requested a review March 7, 2019 15:42
Copy link
Copy Markdown
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

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

LGTM

@imotov imotov merged commit e51665b into elastic:master Mar 8, 2019
imotov added a commit that referenced this pull request Mar 11, 2019
When a query is translated into script terms agg where key has a date
type, it should generate a terms agg with value_type long instead of
date, otherwise the key gets formatted as a string, which confuses
hit extractor.

Fixes #37042
imotov added a commit that referenced this pull request Mar 11, 2019
When a query is translated into script terms agg where key has a date
type, it should generate a terms agg with value_type long instead of
date, otherwise the key gets formatted as a string, which confuses
hit extractor.

Fixes #37042
imotov added a commit that referenced this pull request Mar 12, 2019
When a query is translated into script terms agg where key has a date
type, it should generate a terms agg with value_type long instead of
date, otherwise the key gets formatted as a string, which confuses
hit extractor.

Fixes #37042
@imotov imotov deleted the issue-37042-date-in-key-extractor branch May 1, 2020 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL: grouping by double casted date value throws exception

6 participants