class_docstr: A :class:`~StatementSet` accepts pipelines defined by DML statements or :class:`~Table` objects.
  The planner can optimize all added statements together and then submit them as one job.
  
  The added statements will be cleared when calling the :func:`~StatementSet.execute` method.
  
  .. versionadded:: 1.11.0
docstr: Optimizes all statements as one entity and adds them as transformations to the underlying
  StreamExecutionEnvironment.
  
  Use :func:`~pyflink.datastream.StreamExecutionEnvironment.execute` to execute them.
  
  The added statements will be cleared after calling this method.
  
  .. versionadded:: 1.16.0
docstr_tok: ["Optimizes","all","statements","as","one","entity","and","adds","them","as","transformations","to","the","underlying","StreamExecutionEnvironment",".","Use",":","func",":","`","~pyflink.datastream.StreamExecutionEnvironment.execute","`","to","execute","them",".","The","added","statements","will","be","cleared","after","calling","this","method",".","..","versionadded",":",":","1.16.0"]
code: def attach_as_datastream(self):
      """
      Optimizes all statements as one entity and adds them as transformations to the underlying
      StreamExecutionEnvironment.
  
      Use :func:`~pyflink.datastream.StreamExecutionEnvironment.execute` to execute them.
  
      The added statements will be cleared after calling this method.
  
      .. versionadded:: 1.16.0
      """
      self._j_statement_set.attachAsDataStream()
  
file_path: flink/flink-python/pyflink/table/statement_set.py
imports: from typing import Union
  from pyflink.java_gateway import get_gateway
  from pyflink.table import ExplainDetail
  from pyflink.table.table_descriptor import TableDescriptor
  from pyflink.table.table_result import TableResult
  from pyflink.util.java_utils import to_j_explain_detail_arr
label_desc: Use image node_id 3 for calling the StatementSet obj's underlying member method code with example usage: obj.attach_as_datastream() without return types