mynameborat commented on a change in pull request #1560:
URL: https://github.com/apache/samza/pull/1560#discussion_r788938969



##########
File path: 
samza-core/src/main/java/org/apache/samza/operators/impl/SendToTableOperatorImpl.java
##########
@@ -54,7 +56,12 @@ protected void handleInit(Context context) {
   @Override
   protected CompletionStage<Collection<KV<K, V>>> handleMessageAsync(KV<K, V> 
message, MessageCollector collector,
       TaskCoordinator coordinator) {
-    return table.putAsync(message.getKey(), message.getValue(), 
sendToTableOpSpec.getArgs())
+    if (message.getValue() instanceof UpdateMessage) {
+      throw new SamzaException("Incorrect use of .sendTo operator with 
UpdateMessage value type. "
+          + "Please use the following method on MessageStream- 
sendTo(Table<KV<K, UpdateMessage<U, V>>> table,"
+          + "UpdateOptions updateOptions).");

Review comment:
       looks like thats the case. Maybe we can skip it for now; ideally, we 
should have a this part of the `OperatorSpec` so that we can enable validations 
on these key and value types. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to