Skip to content

Commit

Permalink
fix:confluentinc#3347 If the table has an key and a value for it has …
Browse files Browse the repository at this point in the history
…been provided in an insert then make sure rowkey gets the string form of it
  • Loading branch information
Tim Fox committed Sep 18, 2019
1 parent 62f165b commit d49f282
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,12 @@ private static void handleExplicitKeyField(
final Object rowKeyValue = values.get(SchemaUtil.ROWKEY_NAME);

if (keyValue != null ^ rowKeyValue != null) {
values.putIfAbsent(key, rowKeyValue);
values.putIfAbsent(SchemaUtil.ROWKEY_NAME, keyValue);
if (keyValue == null) {
values.putIfAbsent(key, rowKeyValue);
} else {
// Note, ROWKEY must always be a String
values.putIfAbsent(SchemaUtil.ROWKEY_NAME, keyValue.toString());
}
} else if (!Objects.equals(keyValue, rowKeyValue)) {
throw new KsqlException(
String.format(
Expand Down

0 comments on commit d49f282

Please sign in to comment.