class_docstr: Interface for openlineage-sql.
  
  :param dialect: dialect specific to the database
  :param default_schema: schema applied to each table with no schema parsed
class_docstr_tok: ["Interface","for","openlineage-sql",".",":","param","dialect",":","dialect","specific","to","the","database",":","param","default_schema",":","schema","applied","to","each","table","with","no","schema","parsed"]
docstr: Parses SQL statement(s) and generates OpenLineage metadata.
  
  Generated OpenLineage metadata contains:
  
  * input tables with schemas parsed
  * output tables with schemas parsed
  * run facets
  * job facets.
  
  :param sql: a SQL statement or list of SQL statement to be parsed
  :param hook: Airflow Hook used to connect to the database
  :param database_info: database specific information
  :param database: when passed it takes precedence over parsed database name
  :param sqlalchemy_engine: when passed, engine's dialect is used to compile SQL queries
docstr_tok: ["Parses","SQL","statement","(","s",")","and","generates","OpenLineage","metadata",".","Generated","OpenLineage","metadata","contains",":","*","input","tables","with","schemas","parsed","*","output","tables","with","schemas","parsed","*","run","facets","*","job","facets",".",":","param","sql",":","a","SQL","statement","or","list","of","SQL","statement","to","be","parsed",":","param","hook",":","Airflow","Hook","used","to","connect","to","the","database",":","param","database_info",":","database","specific","information",":","param","database",":","when","passed","it","takes","precedence","over","parsed","database","name",":","param","sqlalchemy_engine",":","when","passed",",","engine","'s","dialect","is","used","to","compile","SQL","queries"]
code: def generate_openlineage_metadata_from_sql(
      self,
      sql: list[str] | str,
      hook: BaseHook,
      database_info: DatabaseInfo,
      database: str | None = None,
      sqlalchemy_engine: Engine | None = None,
  ) -> OperatorLineage:
      """Parses SQL statement(s) and generates OpenLineage metadata.
  
      Generated OpenLineage metadata contains:
  
      * input tables with schemas parsed
      * output tables with schemas parsed
      * run facets
      * job facets.
  
      :param sql: a SQL statement or list of SQL statement to be parsed
      :param hook: Airflow Hook used to connect to the database
      :param database_info: database specific information
      :param database: when passed it takes precedence over parsed database name
      :param sqlalchemy_engine: when passed, engine's dialect is used to compile SQL queries
      """
      job_facets: dict[str, BaseFacet] = {
          "sql": SqlJobFacet(query=self.normalize_sql(sql))
      }
      parse_result = self.parse(self.split_sql_string(sql))
      if not parse_result:
          return OperatorLineage(job_facets=job_facets)
  
      run_facets: dict[str, BaseFacet] = {}
      if parse_result.errors:
          run_facets["extractionError"] = ExtractionErrorRunFacet(
              totalTasks=len(sql) if isinstance(sql, list) else 1,
              failedTasks=len(parse_result.errors),
              errors=[
                  ExtractionError(
                      errorMessage=error.message,
                      stackTrace=None,
                      task=error.origin_statement,
                      taskNumber=error.index,
                  )
                  for error in parse_result.errors
              ],
          )
  
      namespace = self.create_namespace(database_info=database_info)
      inputs, outputs = self.parse_table_schemas(
          hook=hook,
          inputs=parse_result.in_tables,
          outputs=parse_result.out_tables,
          namespace=namespace,
          database=database,
          database_info=database_info,
          sqlalchemy_engine=sqlalchemy_engine,
      )
  
      self.attach_column_lineage(
          outputs, database or database_info.database, parse_result
      )
  
      return OperatorLineage(
          inputs=inputs,
          outputs=outputs,
          run_facets=run_facets,
          job_facets=job_facets,
      )
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Callable
  import sqlparse
  from attrs import define
  from openlineage.client.facet import BaseFacet, ColumnLineageDatasetFacet, ColumnLineageDatasetFacetFieldsAdditional, ColumnLineageDatasetFacetFieldsAdditionalInputFields, ExtractionError, ExtractionErrorRunFacet, SqlJobFacet
  from openlineage.common.sql import DbTableMeta, SqlMeta, parse
  from airflow.providers.openlineage.extractors.base import OperatorLineage
  from airflow.providers.openlineage.utils.sql import TablesHierarchy, create_information_schema_query, get_table_schemas
  from airflow.typing_compat import TypedDict
label_desc: Use image node_id 5 for calling the SQLParser obj's underlying member method code with example usage: obj.generate_openlineage_metadata_from_sql(sql, hook, database_info, database, sqlalchemy_engine) and returns: OperatorLineage, OperatorLineage