[GitHub] [flink] libenchao commented on a change in pull request #11797: [FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte header

2020-04-20 Thread GitBox


libenchao commented on a change in pull request #11797:
URL: https://github.com/apache/flink/pull/11797#discussion_r411235917



##
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/WindowEmitStrategy.scala
##
@@ -63,7 +63,7 @@ class WindowEmitStrategy(
 
   def produceUpdates: Boolean = {
 if (isEventTime) {
-  allowLateness > 0 || earlyFireDelayEnabled || lateFireDelayEnabled
+  earlyFireDelayEnabled || lateFireDelayEnabled

Review comment:
   Then we should modify `WindowOperatorBuilder.withAllowedLateness()` too?





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.

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




[GitHub] [flink] libenchao commented on a change in pull request #11797: [FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte header

2020-04-19 Thread GitBox
libenchao commented on a change in pull request #11797: 
[FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte 
header
URL: https://github.com/apache/flink/pull/11797#discussion_r410911818
 
 

 ##
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/utils/WindowEmitStrategy.scala
 ##
 @@ -63,7 +63,7 @@ class WindowEmitStrategy(
 
   def produceUpdates: Boolean = {
 if (isEventTime) {
-  allowLateness > 0 || earlyFireDelayEnabled || lateFireDelayEnabled
+  earlyFireDelayEnabled || lateFireDelayEnabled
 
 Review comment:
   If we only set allowLateness, then it won't work?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] libenchao commented on a change in pull request #11797: [FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte header

2020-04-19 Thread GitBox
libenchao commented on a change in pull request #11797: 
[FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte 
header
URL: https://github.com/apache/flink/pull/11797#discussion_r410906083
 
 

 ##
 File path: flink-core/src/main/java/org/apache/flink/types/RowKind.java
 ##
 @@ -52,5 +52,26 @@
/**
 * Deletion operation.
 */
-   DELETE
+   DELETE;
+
+   /**
+* Returns a short string representation of this {@link RowKind}.
+*
+* 
+* "I" represents {@link #INSERT}.
+* "UB" represents {@link #UPDATE_BEFORE}.
+* "UA" represents {@link #UPDATE_AFTER}.
+* "D" represents {@link #DELETE}.
+* 
+*/
+   public String shortString() {
 
 Review comment:
   What if we add a parameter for each enum, for example, INSERT("I"), 
UPDATE_BEFORE("UB"). Then we don't need this switch-case?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [flink] libenchao commented on a change in pull request #11797: [FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte header

2020-04-19 Thread GitBox
libenchao commented on a change in pull request #11797: 
[FLINK-17169][table-blink] Refactor BaseRow to use RowKind instead of byte 
header
URL: https://github.com/apache/flink/pull/11797#discussion_r410908757
 
 

 ##
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/dataformat/BinaryRow.java
 ##
 @@ -129,13 +130,15 @@ public int getArity() {
}
 
@Override
-   public byte getHeader() {
+   public RowKind getRowKind() {
// first nullBitsSizeInBytes byte is header.
-   return segments[0].get(offset);
+   byte header = segments[0].get(offset);
+   return RowKind.values()[header];
 
 Review comment:
   IMHO, using enum's values and ordinal is not very elegant.
   How about adding a field explicitly whose meaning is byte encoding for each 
enum?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services