davidradl commented on code in PR #26167: URL: https://github.com/apache/flink/pull/26167#discussion_r1963468045
########## flink-python/pyflink/table/table.py: ########## @@ -1077,6 +1078,91 @@ def explain(self, *extra_details: ExplainDetail) -> str: j_extra_details = to_j_explain_detail_arr(extra_details) return self._j_table.explain(TEXT, j_extra_details) + def insert_into( + self, table_path_or_descriptor: Union[str, TableDescriptor], overwrite: bool = False + ) -> TablePipeline: + """ + When ``target_path_or_descriptor`` is a table path: + + Declares that the pipeline defined by the given :class:`Table` (backed by a + DynamicTableSink) should be written to a table that was registered under the specified + path. + + See the documentation of + :func:`pyflink.table.table_environment.TableEnvironment.use_database` or + :func:`pyflink.table.table_environment.TableEnvironment.use_catalog` for the rules on + the path resolution. + + Example: + :: + + >>> table = table_env.sql_query("SELECTFROM MyTable") + >>> table_pipeline = table.insert_into_table_path("MySinkTable", True) + >>> table_result = table_pipeline.execute().wait() + + When ``target_path_or_descriptor`` is a :class:`~pyflink.table.TableDescriptor` : + + Declares that the pipeline defined by the given :class:`Table` object should be written + to a table (backed by a DynamicTableSink) expressed via the given + :class:`~pyflink.table.TableDescriptor`. + + The descriptor won't be registered in the catalog, but it will be propagated directly + in the operation tree. Note that calling this method multiple times, even with the same + descriptor, results in multiple sink tables instances. + + This method allows to declare a :class:`~pyflink.table.Schema` for the sink descriptor. Review Comment: nit: `This method allows to declare` -> A :class:`~pyflink.table.Schema` can be associated with the sink descriptor -- 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. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org