davidradl commented on code in PR #26167:
URL: https://github.com/apache/flink/pull/26167#discussion_r1963472704
##########
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.
+ The declaration is similar to a ``CREATE TABLE`` DDL in SQL and
allows to:
Review Comment:
maybe change this to. Specifying a schema asserts a structure to the table
and can be used to:
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]