Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-36488] [TABLE SQL/API] Remove deprecated methods StreamTableEnvironment.toAppendStream from flink-table-api-java-bridge module #25528

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

sn-12-3
Copy link
Contributor

@sn-12-3 sn-12-3 commented Oct 16, 2024

JIRA issue

FLINK-36488

What is the purpose of the change

Remove deprecated method from StreamTableEnvironment.toAppendStream . This links to parent issue FLINK-36476

Brief change log

Remove deprecated methods StreamTableEnvironment.toAppendStream from flink-table-api-java-bridge module.

Verifying this change

Use mvn spotless:apply to verify.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@sn-12-3 sn-12-3 changed the title [FLINK-36488] [TABLE SQL/API] Remove deprecated methods StreamTableEn… [FLINK-36488] [TABLE SQL/API] Remove deprecated methods StreamTableEnvironment.toAppendStream from flink-table-api-java-bridge module Oct 16, 2024
@flinkbot
Copy link
Collaborator

flinkbot commented Oct 16, 2024

CI report:

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

…vironment.toAppendStream from flink-table-api-java-bridge module
@sn-12-3 sn-12-3 force-pushed the 36488-remove-deprecated-methods branch from b14a9b3 to ee7e6b9 Compare October 17, 2024 06:46
@sn-12-3 sn-12-3 force-pushed the 36488-remove-deprecated-methods branch from ee7e6b9 to 4a70d1f Compare November 12, 2024 07:39
@davidradl
Copy link
Contributor

@sn-12-3 do you mean to have this PR in draft ?

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Dec 5, 2024

Yes @davidradl , This PR CI is failing due to a python failure which still needs investigation.

@xuyangzhong
Copy link
Contributor

Hi, @sn-12-3 Is there any new progress?

@sn-12-3 sn-12-3 force-pushed the 36488-remove-deprecated-methods branch from 91b315b to 6da38a6 Compare January 12, 2025 09:49
@sn-12-3 sn-12-3 force-pushed the 36488-remove-deprecated-methods branch from f0ac0a3 to 8c869c8 Compare January 13, 2025 15:14
@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 13, 2025

@flinkbot run azure

@sn-12-3 sn-12-3 marked this pull request as ready for review January 14, 2025 04:27
@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 14, 2025

Hi @xuyangzhong , This PR is ready for review now. I have removed the toAppendStream method from Scala and few tests which had references. Kindly let me know if any further changes is needed.

Copy link
Contributor

@xuyangzhong xuyangzhong left a comment

Choose a reason for hiding this comment

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

Thanks for updating this pr! I just left some comments.
BTW, it seems that the cleanup hasn't been completely done. When I search for toAppendStream and to_append_stream in the IDE, I still find many references that need to be removed, such as in doc/content/docks/dev/table/data_stream_api.md, table_environment.py, etc.

@@ -260,57 +260,6 @@ def test_execute_async(self):
execution_result = job_client.get_job_execution_result().result()
self.assertEqual(str(job_id), str(execution_result.get_job_id()))

def test_add_python_file(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we can directly remove this test, as it seems to verify other functionalities.

Copy link
Contributor Author

@sn-12-3 sn-12-3 Jan 18, 2025

Choose a reason for hiding this comment

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

Used to_data_stream instead of to_append_stream.

@@ -1290,47 +1290,6 @@ class WindowAggregateITCase(
.isEqualTo(expected.sorted.mkString("\n"))
}

@TestTemplate
def testDistinctAggWithMergeOnEventTimeSessionWindow(): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

@sn-12-3 sn-12-3 Jan 18, 2025

Choose a reason for hiding this comment

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

Used toDataStream instead of toAppendStream.

<T> DataStream<T> toAppendStream(Table table, TypeInformation<T> typeInfo);

/**
* Converts the given {@link Table} into a {@link DataStream} of add and retract messages. The
Copy link
Contributor

Choose a reason for hiding this comment

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

You removed the comment for toRetractStream but kept the comment for toAppendStream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad. Apologies, corrected now.

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 15, 2025

@flinkbot run azure

Converts the given Table into a DataStream.

Since the DataStream API does not support changelog processing natively, this method
assumes append-only/insert-only semantics during the table-to-stream conversion. The records
Copy link
Contributor

@davidradl davidradl Jan 15, 2025

Choose a reason for hiding this comment

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

nit: the documentation only refers to insert-only. Can we remove append-only or is this indicating another semantic?

Maybe involve parts of the original comment "Converts the given Table into a DataStream of a specified type. Since the DataStream API does not support changelog processing natively, the table must only have insert (append) changes. If the Table is also modified by update or delete changes, the conversion will fail."

Copy link
Contributor Author

@sn-12-3 sn-12-3 Jan 18, 2025

Choose a reason for hiding this comment

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

It seems to indicate another semantic fit for insert-only operation. Elsewhere in the codebase, the same documentation is maintained.

After the changes based on the review comments, this is outdated as no new function has been added in this file. Only to_append_stream relevant function has been removed.

Types.STRING()]))
test_sink = DataStreamTestSinkFunction()
ds.add_sink(test_sink)
self.env.execute("test_to_data_stream")
Copy link
Contributor

Choose a reason for hiding this comment

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

can we test deletes and updates error cases?

Copy link
Contributor Author

@sn-12-3 sn-12-3 Jan 18, 2025

Choose a reason for hiding this comment

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

I'm afraid I understand, this is adding the sink operator to the dataStream function, there is no functions related to delete or update.

After the changes based on the review comments, this is outdated as no new test has been added in this file. Only toAppendStream relevant test case has been removed.

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 18, 2025

@flinkbot run azure

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 18, 2025

@xuyangzhong , @davidradl , Thanks for the review. Incorporated the review comments; PR is ready for re-review.

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Jan 27, 2025

@xuyangzhong , @davidradl , Gentle reminder.

@sn-12-3
Copy link
Contributor Author

sn-12-3 commented Feb 20, 2025

@flinkbot run azure

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.

4 participants