Skip to content

Conversation

@YasuoStudyJava
Copy link
Contributor

Description:
In linux-arch64 environment, “window_type is OverWindow.ROW_UNBOUNDED_FOLLOWING” in the PandasBatchOverWindowAggregateFunctionOperation class of the pyflink source code has returned the wrong result. For example, when window_type is 6, it represents the window type of ‘ROW_UNBOUNDED_FOLLOWING’, but “window_type is OverWindow.ROW_UNBOUNDED_FOLLOWING” return false because the memory address of window_type has changed. It will lead to the wrong type of window, such as row sliding window, so, the wrong results of pandas udf have appeared.

Solutions:
Since the window selections need to compare the values of two integer variables, I recommend replacing ‘is’ with ‘==’. That can also prevents erroneous results caused by Python small integer object pool failure. And it has been verified to perform correctly on both x86 and aarch64 environments.

Related Jira Issue: FLINK-30637 (https://issues.apache.org/jira/browse/FLINK-30637)

Description: 
In linux-arch64 environment, “window_type is OverWindow.ROW_UNBOUNDED_FOLLOWING” in the PandasBatchOverWindowAggregateFunctionOperation class of the pyflink source code has returned the wrong result. For example, when window_type is 6, it represents the window type of ‘ROW_UNBOUNDED_FOLLOWING’, but “window_type is OverWindow.ROW_UNBOUNDED_FOLLOWING” return false because the memory address of window_type has changed. It will lead to the wrong type of window, such as row sliding window, so, the wrong results of pandas udf have appeared.
Solutions:
Since the window selections need to compare the values of two integer variables, I recommend replacing ‘is’ with ‘==’. And it has been verified to perform correctly on both x86 and aarch64 environments.
@YasuoStudyJava YasuoStudyJava changed the title Update operations.py [FLINK-30637] [Python] Try to replace 'is' with '==' to ensure matching the window type of overwindow correctly Jan 11, 2023
@flinkbot
Copy link
Collaborator

flinkbot commented Jan 11, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@HuangXingBo HuangXingBo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix.

HuangXingBo pushed a commit that referenced this pull request Jan 17, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes #21649.
HuangXingBo pushed a commit that referenced this pull request Jan 17, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes #21649.
chucheng92 pushed a commit to chucheng92/flink that referenced this pull request Feb 3, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes apache#21649.
sergeitsar pushed a commit to fentik/flink that referenced this pull request Feb 8, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes apache#21649.
sergeitsar pushed a commit to fentik/flink that referenced this pull request Feb 8, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes apache#21649.
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
…ssues with OverWindow Aggregation On Linux-arch64

This closes apache#21649.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants