Skip to content

Commit 2b80085

Browse files
committed
Added BigQuery Metastore Catalog
1 parent 8db086d commit 2b80085

7 files changed

Lines changed: 755 additions & 0 deletions

File tree

mkdocs/docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ You can mix and match optional dependencies depending on your needs:
4646
| hive-kerberos | Support for Hive metastore in Kerberos environment |
4747
| glue | Support for AWS Glue |
4848
| dynamodb | Support for AWS DynamoDB |
49+
| bigquery | Support for Google Cloud BigQuery |
4950
| sql-postgres | Support for SQL Catalog backed by Postgresql |
5051
| sql-sqlite | Support for SQL Catalog backed by SQLite |
5152
| pyarrow | PyArrow as a FileIO implementation to interact with the object store |

pyiceberg/catalog/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class CatalogType(Enum):
118118
DYNAMODB = "dynamodb"
119119
SQL = "sql"
120120
IN_MEMORY = "in-memory"
121+
BIGQUERY = "bigquery"
121122

122123

123124
def load_rest(name: str, conf: Properties) -> Catalog:
@@ -172,6 +173,15 @@ def load_in_memory(name: str, conf: Properties) -> Catalog:
172173
except ImportError as exc:
173174
raise NotInstalledError("SQLAlchemy support not installed: pip install 'pyiceberg[sql-sqlite]'") from exc
174175

176+
def load_bigquery(name: str, conf: Properties) -> Catalog:
177+
try:
178+
from pyiceberg.catalog.bigquery_metastore import BigQueryMetastoreCatalog
179+
180+
return BigQueryMetastoreCatalog(name, **conf)
181+
except ImportError as exc:
182+
raise NotInstalledError("BigQuery support not installed: pip install 'pyiceberg[bigquery]'") from exc
183+
184+
175185

176186
AVAILABLE_CATALOGS: dict[CatalogType, Callable[[str, Properties], Catalog]] = {
177187
CatalogType.REST: load_rest,
@@ -180,6 +190,7 @@ def load_in_memory(name: str, conf: Properties) -> Catalog:
180190
CatalogType.DYNAMODB: load_dynamodb,
181191
CatalogType.SQL: load_sql,
182192
CatalogType.IN_MEMORY: load_in_memory,
193+
CatalogType.BIGQUERY: load_bigquery,
183194
}
184195

185196

0 commit comments

Comments
 (0)