JingsongLi edited a comment on issue #8102: [FLINK-12087][table-runtime-blink] 
Introduce over window operators to blink batch
URL: https://github.com/apache/flink/pull/8102#issuecomment-480694448
 
 
   Consider a new `BaseSlidingOverFrame`:
   It has two abstract method:
   1.`public abstract boolean isLeftBoundRowInWindow(BaseRow inputRow, int 
inputIndex, BaseRow currentRow, int currentIndex);`
   2.`public abstract boolean isRightBoundRowInWindow(BaseRow inputRow, int 
inputIndex, BaseRow currentRow, int currentIndex);`
   In `process`, it will invoke `isLeftBoundRowInWindow` and 
`isRightBoundRowInWindow` to determine boundaries.
   
   In `RowSlidingOverFrame`:
   ```
        @Override
        public boolean isLeftBoundRowInWindow(BaseRow inputRow, int inputIndex, 
BaseRow currentRow,
                        int currentIndex) {
                return inputIndex >= currentIndex + leftOffset;
        }
   
        @Override
        public boolean isRightBoundRowInWindow(BaseRow inputRow, int 
inputIndex, BaseRow currentRow,
                        int currentIndex) {
                return inputIndex <= currentIndex + rightOffset;
        }
   ```
   
   In `RangeSlidingOverFrame`:
   ```
        @Override
        public boolean isLeftBoundRowInWindow(BaseRow inputRow, int inputIndex, 
BaseRow currentRow,
                        int currentIndex) {
                return lbound.compare(inputRow, currentRow) >= 0;
        }
   
        @Override
        public boolean isRightBoundRowInWindow(BaseRow inputRow, int 
inputIndex, BaseRow currentRow,
                        int currentIndex) {
                return rbound.compare(inputRow, currentRow) <= 0;
        }
   ```
   
   I mean the `isLeftBoundRowInWindow` and `isRightBoundRowInWindow` make thing 
more complicated. Still has args: `(BaseRow inputRow, int inputIndex, BaseRow 
currentRow, int currentIndex)`.

----------------------------------------------------------------
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

Reply via email to