Fix composite agg serialization error

Fix serialization after backport

Relates #29465
This commit is contained in:
Jim Ferenczi 2018-05-30 14:22:48 +02:00
parent 1ea9f11b03
commit 532b91ffa6
1 changed files with 5 additions and 4 deletions

View File

@ -72,8 +72,8 @@ public abstract class CompositeValuesSourceBuilder<AB extends CompositeValuesSou
} else {
this.missingBucket = false;
}
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
// skip missing value
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
// skip missing value for BWC
in.readGenericValue();
}
this.order = SortOrder.readFromStream(in);
@ -98,10 +98,11 @@ public abstract class CompositeValuesSourceBuilder<AB extends CompositeValuesSou
if (hasValueType) {
valueType.writeTo(out);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeBoolean(missingBucket);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
// write missing value for BWC
out.writeGenericValue(null);
}
order.writeTo(out);