class_docstr: Describes a schema of a table.
  
  .. note::
  
      Field names are matched by the exact name by default (case sensitive).
class_docstr_tok: ["Describes","a","schema","of","a","table",".","..","note",":",":","Field","names","are","matched","by","the","exact","name","by","default","(","case","sensitive",")","."]
docstr: Sets the schema with field names and the types. Required.
  
  This method overwrites existing fields added with
  :func:`~pyflink.table.descriptors.Schema.field`.
  
  :param table_schema: The :class:`TableSchema` object.
  :return: This schema object.
docstr_tok: ["Sets","the","schema","with","field","names","and","the","types",".","Required",".","This","method","overwrites","existing","fields","added","with",":","func",":","`","~pyflink.table.descriptors.Schema.field","`",".",":","param","table_schema",":","The",":","class",":","`","TableSchema","`","object",".",":","return",":","This","schema","object","."]
code: def schema(self, table_schema: "TableSchema") -> "Schema":
      """
      Sets the schema with field names and the types. Required.
  
      This method overwrites existing fields added with
      :func:`~pyflink.table.descriptors.Schema.field`.
  
      :param table_schema: The :class:`TableSchema` object.
      :return: This schema object.
      """
      self._j_schema = self._j_schema.schema(
          table_schema._j_table_schema
      )
      return self
  
imports: import sys
  from abc import ABCMeta
  from collections import OrderedDict
  from py4j.java_gateway import get_method
  from typing import Dict, Union
  from pyflink.java_gateway import get_gateway
  from pyflink.table.table_schema import TableSchema
  from pyflink.table.types import DataType, _to_java_data_type
label_desc: Use image node_id 2 for calling the Schema obj's underlying member method code with example usage: obj.schema(table_schema) and returns: self