mobuchowski commented on code in PR #32910:
URL: https://github.com/apache/airflow/pull/32910#discussion_r1284668277


##########
airflow/providers/openlineage/utils/sql.py:
##########
@@ -155,11 +155,17 @@ def create_information_schema_query(
     metadata = MetaData(sqlalchemy_engine)
     select_statements = []
     for db, schema_mapping in tables_hierarchy.items():
-        schema, table_name = information_schema_table_name.split(".")
         if db:
-            schema = f"{db}.{schema}"
+            schema = db

Review Comment:
   Does this mean `schema` is `database schema` in Oracle meaning here, not 
`schema of a database`? Would be nice to document this if true - this is cause 
of many errors usually.



##########
airflow/providers/trino/hooks/trino.py:
##########
@@ -233,3 +233,32 @@ def _serialize_cell(cell: Any, conn: Connection | None = 
None) -> Any:
         :return: The cell
         """
         return cell
+
+    def get_openlineage_database_info(self, connection):
+        """Returns Trino specific information for OpenLineage."""
+        from airflow.providers.openlineage.sqlparser import DatabaseInfo
+
+        return DatabaseInfo(
+            scheme="trino",
+            authority=DbApiHook.get_openlineage_authority_part(
+                connection, default_port=trino.constants.DEFAULT_PORT
+            ),
+            information_schema_columns=[
+                "table_schema",
+                "table_name",
+                "column_name",
+                "ordinal_position",
+                "data_type",
+                "table_catalog",
+            ],
+            database=connection.extra_dejson.get("catalog", "hive"),
+            is_information_schema_cross_db=True,
+        )
+
+    def get_openlineage_database_dialect(self, _):
+        """Returns database dialect."""
+        return "trino"
+
+    def get_openlineage_default_schema(self):
+        """MySQL has no concept of schema."""

Review Comment:
   ```suggestion
           """Trino has no concept of schema."""
   ```



-- 
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]

Reply via email to