kacpermuda commented on code in PR #66844:
URL: https://github.com/apache/airflow/pull/66844#discussion_r3240079446
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:
##########
@@ -177,6 +177,36 @@ def _get_conn_params(self) -> dict[str, str | None]:
aws_domain=self.conn.extra_dejson.get("aws_domain",
"amazonaws.com"),
)
+ def get_openlineage_database_info(self, connection):
+ """Return Amazon Athena specific information for OpenLineage."""
+ from airflow.providers.openlineage.sqlparser import DatabaseInfo
+
+ region_name = connection.extra_dejson.get("region_name") or
self.region_name
+ authority = f"athena.{region_name}.amazonaws.com" if region_name else
"athena.amazonaws.com"
+
+ return DatabaseInfo(
+ scheme="awsathena",
+ authority=authority,
+ information_schema_columns=[
+ "table_schema",
+ "table_name",
+ "column_name",
+ "ordinal_position",
+ "data_type",
+ "table_catalog",
+ ],
+ database=connection.extra_dejson.get("catalog", "AwsDataCatalog"),
+ is_information_schema_cross_db=True,
Review Comment:
Just a question, did you validate this code on actual athena instance. I
remember aws redshift having some issues with schema queries, we needed to add
`use_flat_cross_db_query=True` there as well. Those are probably two separate
cases, just wanted to make sure that this was tested and works as expected
(information_schema_columns is correct, is_information_schema_cross_db should
be True etc.)
--
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]