You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2022/01/27 21:38:07 UTC

[GitHub] [samza] ajothomas opened a new pull request #1579: SAMZA-2717: Adding docs for table api updates

ajothomas opened a new pull request #1579:
URL: https://github.com/apache/samza/pull/1579


   Issue:
   - The existing documentation for Table API is stale with incorrect class diagrams
   - No information regarding updates
   
   Changes:
   - New class diagram for table api is added
   - Adding information related to updates to table api and high level api page with code examples
   
   Tests
   ./gradlew build 


-- 
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: commits-unsubscribe@samza.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [samza] xinyuiscool merged pull request #1579: SAMZA-2717: Adding docs for table api updates

Posted by GitBox <gi...@apache.org>.
xinyuiscool merged pull request #1579:
URL: https://github.com/apache/samza/pull/1579


   


-- 
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: commits-unsubscribe@samza.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [samza] xinyuiscool commented on a change in pull request #1579: SAMZA-2717: Adding docs for table api updates

Posted by GitBox <gi...@apache.org>.
xinyuiscool commented on a change in pull request #1579:
URL: https://github.com/apache/samza/pull/1579#discussion_r796155522



##########
File path: docs/learn/documentation/versioned/api/high-level-api.md
##########
@@ -260,6 +260,25 @@ Sends all messages in this MessageStream to the provided Table. The expected mes
         
 {% endhighlight %}
 
+Sends all update messages in this MessageStream to the provided Table. The expected message type is [KV](javadocs/org/apache/samza/operators/KV).
+V should be on type UpdateMessage which defines an update message and an optional default to be inserted in the absence of an existing record.
+User also needs to pass an UpdateOptions parameter as well in the sendTo call of MessageStream. It defines the behavior of the sendTo-table operator 
+in terms of whether it should insert a default in the absence of an existing record or not.
+
+{% highlight java %}
+
+    MessageStream<Profile> profilesStream = ...
+    Table<KV<Long, UpdateMessage<Profile, String>>> profilesTable =

Review comment:
       A couple of issue with this example: first we are not allowed to use word "member" "profile" in open source code. These are li terminologies. Please replace with common words, like Event, User, etc. 
   
   secondly, should the table type still be Table<KV<Long, Profile>>? The table def seems won't need this update type. 
   
   Last, from the sendTo api, seems the map() in the code should map from profile to a KV of <Integer, UpdateMessage>, not KV<Integer, String>
   
   <K, V, U> MessageStream<KV<K, UpdateMessage<U, V>>> sendTo(Table<KV<K, V>> table, UpdateOptions updateOptions);
   




-- 
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: commits-unsubscribe@samza.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org