mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-25 17:04:54 +00:00
* Fix: Clickhouse view lineage * Fix: Clickhouse view lineage * Fix: Clickhouse view lineage
This commit is contained in:
parent
4ef1f4b729
commit
55b6fca9c9
@ -19,6 +19,9 @@ from sqlalchemy import util as sa_util
|
|||||||
from sqlalchemy.engine import reflection
|
from sqlalchemy.engine import reflection
|
||||||
from sqlalchemy.util import warn
|
from sqlalchemy.util import warn
|
||||||
|
|
||||||
|
from metadata.generated.schema.entity.services.connections.database.clickhouseConnection import (
|
||||||
|
ClickhouseConnection,
|
||||||
|
)
|
||||||
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
|
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
|
||||||
OpenMetadataConnection,
|
OpenMetadataConnection,
|
||||||
)
|
)
|
||||||
@ -136,15 +139,23 @@ def get_table_comment(self, connection, table_name, schema=None, **kw):
|
|||||||
return {"text": None}
|
return {"text": None}
|
||||||
|
|
||||||
|
|
||||||
|
@reflection.cache
|
||||||
|
def get_view_definition(self, connection, view_name, schema=None, **kw):
|
||||||
|
try:
|
||||||
|
query = f"select create_table_query from system.tables where engine = 'View' and name='{view_name}' and database='{schema}'"
|
||||||
|
result = connection.execute(query)
|
||||||
|
view_definition = result.fetchone()
|
||||||
|
return view_definition[0] if view_definition else ""
|
||||||
|
except Exception:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
ClickHouseDialect.get_unique_constraints = get_unique_constraints
|
ClickHouseDialect.get_unique_constraints = get_unique_constraints
|
||||||
ClickHouseDialect.get_pk_constraint = get_pk_constraint
|
ClickHouseDialect.get_pk_constraint = get_pk_constraint
|
||||||
ClickHouseDialect._get_column_type = _get_column_type
|
ClickHouseDialect._get_column_type = _get_column_type
|
||||||
ClickHouseDialect.get_table_comment = get_table_comment
|
ClickHouseDialect.get_table_comment = get_table_comment
|
||||||
RequestsTransport.execute = execute
|
RequestsTransport.execute = execute
|
||||||
|
ClickHouseDialect.get_view_definition = get_view_definition
|
||||||
from metadata.generated.schema.entity.services.connections.database.clickhouseConnection import (
|
|
||||||
ClickhouseConnection,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ClickhouseSource(SQLSource):
|
class ClickhouseSource(SQLSource):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user