Repository navigation
Conversation
|
@ykisana For the next time, please wait with opening a PR until you're assigned to the Jira ticket |
| public long assignSliceEnd(RowData element, ClockService clock) { | ||
| if (element.isNullAt(sliceEndIndex)) { | ||
| throw new IllegalStateException( | ||
| "Slice end of a sliced input row is null. This is a bug."); |
There was a problem hiding this comment.
and what is call to action to user?
There was a problem hiding this comment.
this is a bug where?
flink, jdk, data, something else?
if I see it as a user how can this message help me?
There was a problem hiding this comment.
@snuyanzin I tried to follow bug messages in the rest of the repo 'This is a bug' is found in other places. It's an IllegalStateException. User can't do anything about it, bug on our side.
Updating to make this more clear though. Let me know if you have suggestions.
There was a problem hiding this comment.
User can't do anything about it, bug on our side.
if somewhere is NPE it is also bug in Flink, however I hardly tend to think that we need to insert tons of checks for NPE and for every tell that bug in our side because something is null...
Can we better try to understand cases we come here and why?
There was a problem hiding this comment.
@snuyanzin Yeah I agree. What's the process for that?
The ticket is for error messaging. I can do a follow up for looking at paths where we actually enter this state.
d725e52 to
271fe01
Compare
snuyanzin
left a comment
There was a problem hiding this comment.
Slice end of the input row is null, but it is always set by the upstream local window aggregate. This is a bug in Flink. Please file an issue.
this is false
after looking into that it is data/user issue rather than Flink bug
|
you can repro this with a query like SELECT a, window_start, window_end, COUNT(*) FROM TUMBLE(TABLE src, DESCRIPTOR(rt), INTERVAL '5' SECOND) GROUP BY a, window_start, window_endand then pass |
Thanks for looking into this and finding this! Yeah those code paths are still reachable. I was able to confirm with that query. I believe WindowedUnsliceAssigner seeing NULL bounds is still unreachable, so I kept that in. Updated message following other examples in Flink. |
| throw new IllegalStateException( | ||
| "Window start or window end of the input row is null. " | ||
| + "Both should be set by the upstream window operator. " | ||
| + "This is a bug. Please file an issue."); |
There was a problem hiding this comment.
why do we need this?
i'm pretty sure same story
There was a problem hiding this comment.
@snuyanzin At this stage we only expect valid windows, NULL rowtimes are rejected upstream. I believe this path is unreachable.
There was a problem hiding this comment.
I believe this path is unreachable.
it is not a proof, need something more reliable as a proof
There was a problem hiding this comment.
I believe this path is unreachable.
also even if it is true, why do we even touch unreachable message?
There was a problem hiding this comment.
@snuyanzin I'm happy to leave message as is, or maybe just change to invalid state exception.
The purpose of ticket was clearer messaging: https://issues.apache.org/jira/browse/FLINK-40949
As for why it should be unreachable:
If survived these checks, they get real bounds:
http://github.com/apache/flink/blob/master/flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/window/tvf/operator/WindowTableFunctionOperatorBase.java#L109-L121
Expected real bounds here:
http://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/physical/stream/StreamPhysicalWindowAggregateRule.scala#L111-L115
Thus real bounds here (which calls the function I changed):
http://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/stream/StreamExecWindowAggregateBase.java#L77-L90
Note, your counter example only proved for SliceAssigners in a DIFFERENT path.
In this path, SliceAssigners also is expected real bounds.
UnsliceAssigners only lives here. It doesn't live in other paths without real bound pruning like here.
Let me know if I missed anything or how I should handle this.
Change exception? Or just leave as is? Ticket wanted something different here.
There was a problem hiding this comment.
change only message like
throw new RuntimeException("Both window start and window end should not be null.");
There was a problem hiding this comment.
@snuyanzin updated, thanks for confirming. simple pr now
c7f2459 to
874c00b
Compare
|
the commit/pr message is still vague
reporting it as NOT NULL rowtime also satisfying this message however it is not true |
|
also ci is red |
What is the purpose of the change
UnsliceAssigners.WindowedUnsliceAssignershould not have a NULL Window edge elements at either (windowStartIndexandwindowStartIndex).The current exception messaging (
RowTime field should not be null.) isn't clear. We can make this more clear.As per: FLINK-40949
Brief change log
CreateWindowinWindowedUnsliceAssignerhas an updated message.RowTime field should not be null.Both window start and window end should not be null.Verifying this change
This is just a simple renaming of a string. We don't need explicit tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
While AI was used before for PR desc/comments, current state of everything has no AI.