mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-06 08:38:41 +00:00

Co-authored-by: ksrinath <ksrinath@users.noreply.github.com> Co-authored-by: Chakravarthy Racharla <chakru.racharla@acryl.io>
16 lines
530 B
Python
16 lines
530 B
Python
from constants import namespace, table_name, warehouse
|
|
from pyiceberg.catalog import load_catalog
|
|
|
|
# Load the catalog
|
|
from datahub.ingestion.graph.client import get_default_graph
|
|
|
|
graph = get_default_graph()
|
|
|
|
catalog = load_catalog("local_datahub", warehouse=warehouse, token=graph.config.token)
|
|
# Append the data to the Iceberg table
|
|
table = catalog.load_table(f"{namespace}.{table_name}")
|
|
con = table.scan().to_duckdb(table_name=f"{table_name}")
|
|
|
|
for row in con.execute(f"SELECT * FROM {table_name}").fetchall():
|
|
print(row)
|