Skip to content

Commit

Permalink
[FLINK-18484][core] Add length difference to arity exception in RowSe…
Browse files Browse the repository at this point in the history
…rializer
  • Loading branch information
mans2singh authored and aljoscha committed Jul 9, 2020
1 parent 35865f7 commit bab03e7
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public Row copy(Row from) {
int len = fieldSerializers.length;

if (from.getArity() != len) {
throw new RuntimeException("Row arity of from does not match serializers.");
throw new RuntimeException("Row arity of from (" + from.getArity() +
") does not match this serializers field length (" + len + ").");
}

Row result = new Row(from.getKind(), len);
Expand Down Expand Up @@ -138,7 +139,7 @@ public Row copy(Row from, Row reuse) {

if (from.getArity() != len || reuse.getArity() != len) {
throw new RuntimeException(
"Row arity of reuse or from is incompatible with this RowSerializer.");
"Row arity of reuse (" + reuse.getArity() + ") or from (" + from.getArity() + ") is incompatible with this serializers field length (" + len + ").");
}

reuse.setKind(from.getKind());
Expand Down Expand Up @@ -177,7 +178,7 @@ public void serialize(Row record, DataOutputView target) throws IOException {
final int len = fieldSerializers.length;

if (record.getArity() != len) {
throw new RuntimeException("Row arity of from does not match serializers.");
throw new RuntimeException("Row arity of record (" + record.getArity() + ") does not match this serializers field length (" + len + ").");
}

// write bitmask
Expand Down Expand Up @@ -221,7 +222,7 @@ public Row deserialize(Row reuse, DataInputView source) throws IOException {
final int len = fieldSerializers.length;

if (reuse.getArity() != len) {
throw new RuntimeException("Row arity of from does not match serializers.");
throw new RuntimeException("Row arity of reuse (" + reuse.getArity() + ") does not match this serializers field length (" + len + ").");
}

// read bitmask
Expand Down

0 comments on commit bab03e7

Please sign in to comment.