-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hive metastore catalog support (part 2/2) (#285)
* fmt members * setup basic test-infra for hms-catalog * add license * add hms create_namespace * add hms get_namespace * fix: typo * add hms namespace_exists and drop_namespace * add hms update_namespace * move fns into HmsCatalog * use `expose` in docker-compose * add hms list_tables * fix: clippy * fix: cargo sort * fix: cargo workspace * move fns into utils + add constants * include database name in error msg * add pilota to cargo workspace * add minio version * change visibility to pub(crate); return namespace from conversion fn * add minio version in rest-catalog docker-compose * fix: hms test docker infrastructure * add version to minio/mc * fix: license header * fix: core-site * split utils and errors * add fn get_default_table_location * add fn get_metadata_location * add docs * add HiveSchemaBuilder * add schema to HiveSchemaBuilder * add convert_to_hive_table * cargo sort * implement table_ops without TableMetadataBuilder * refactor: HiveSchema fn from_iceberg * prepare table creation without metadata * simplify HiveSchemaBuilder * refactor: use ok_or_else() * simplify HiveSchemaBuilder * fix visibility of consts * change serde metadata v2 * change default partition_specs and sort_orders * change test * add create table with metadata * use FileIO::from_path * add test_load_table * small fixes + docs * rename * extract get_metadata_location from hive_table * add integration tests * fix: clippy * remove whitespace * fix: fixture names * remove builder-prefix `with` * capitalize error msg * remove trait bound `Display` * add const `OWNER` * fix: default warehouse location * add test-case `list_tables` * add all primitives to test_schema * exclude `Timestamptz` from hive conversion * remove Self::T from schema * remove context * keep file_io in HmsCatalog * use json schema repr --------- Co-authored-by: mlanhenke <[email protected]>
- Loading branch information
1 parent
757ef4c
commit 0629ad5
Showing
7 changed files
with
1,167 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
use anyhow::anyhow; | ||
use iceberg::{Error, ErrorKind}; | ||
use std::fmt::Debug; | ||
use std::io; | ||
|
||
/// Format a thrift error into iceberg error. | ||
pub fn from_thrift_error<T>(error: volo_thrift::error::ResponseError<T>) -> Error | ||
where | ||
T: Debug, | ||
{ | ||
Error::new( | ||
ErrorKind::Unexpected, | ||
"Operation failed for hitting thrift error".to_string(), | ||
) | ||
.with_source(anyhow!("thrift error: {:?}", error)) | ||
} | ||
|
||
/// Format an io error into iceberg error. | ||
pub fn from_io_error(error: io::Error) -> Error { | ||
Error::new( | ||
ErrorKind::Unexpected, | ||
"Operation failed for hitting io error".to_string(), | ||
) | ||
.with_source(error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,6 @@ | |
mod catalog; | ||
pub use catalog::*; | ||
|
||
mod error; | ||
mod schema; | ||
mod utils; |
Oops, something went wrong.