-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
[ML][Data Frame] Add deduced mappings to _preview response payload #43742
[ML][Data Frame] Add deduced mappings to _preview response payload #43742
Conversation
Pinging @elastic/ml-core |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 question, looks good otherwise.
Wondering about check in: do not we have to use Version.Current and change it to 7.3.0 in a followup to not break BWC?
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeInt(docs.size()); | ||
for (Map<String, Object> doc : docs) { | ||
out.writeMapWithConsistentOrder(doc); | ||
} | ||
if (out.getVersion().onOrAfter(Version.V_7_3_0)) { | ||
out.writeMap(mappings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems mappings can be null
, so would it make sense to use optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hendrikmuhs writeMap
and readMap
when it is just a Map<String,Object>
handles null
values internally.
There are also no BWC tests yet...still waiting on PR: #43506
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok checked it, implicit magic, well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeInt(docs.size()); | ||
for (Map<String, Object> doc : docs) { | ||
out.writeMapWithConsistentOrder(doc); | ||
} | ||
if (out.getVersion().onOrAfter(Version.V_7_3_0)) { | ||
out.writeMap(mappings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok checked it, implicit magic, well...
run elasticsearch-ci/1 |
@elasticmachine update branch |
…lastic#43742) * [ML][Data Frame] Add deduced mappings to _preview response payload * updating preview docs
This updates the
_preview
response payload to include the deduced mappings. The "mapping" format returned fromPivot#deduceMappings
has a non-standard format of{"field1": "field1Type", "field2.subfield": "field2.subfieldType"}
. So, I opted to transform it so that it is in an appropriate format ofRelated to: elastic/kibana#39250