Skip to content

Commit

Permalink
feat: add support for partition columns
Browse files Browse the repository at this point in the history
  • Loading branch information
timvw committed Apr 23, 2024
1 parent 995f311 commit b53d2ea
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/catalog_provider/glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ impl GlueCatalogProvider {
let sd = Self::get_storage_descriptor(glue_table)?;
let storage_location_uri = Self::get_storage_location(&sd)?;

let listing_options = Self::get_listing_options(database_name, table_name, &sd, glue_table)?;
let listing_options =
Self::get_listing_options(database_name, table_name, &sd, glue_table)?;

let schema_provider_for_database = self.ensure_schema_provider_for_database(database_name);

Expand Down Expand Up @@ -281,7 +282,7 @@ impl GlueCatalogProvider {
}
}

fn calculate_options(glue_table: &Table,sd: &StorageDescriptor) -> Result<ListingOptions> {
fn calculate_options(glue_table: &Table, sd: &StorageDescriptor) -> Result<ListingOptions> {
let empty_str = String::from("");
let input_format = sd.input_format.as_ref().unwrap_or(&empty_str);
let output_format = sd.output_format.as_ref().unwrap_or(&empty_str);
Expand Down Expand Up @@ -369,7 +370,12 @@ impl GlueCatalogProvider {
let partition_cols = glue_table
.partition_keys()
.iter()
.map(|c| (c.name().to_owned(), Self::map_glue_data_type(&c.r#type.clone().unwrap()).unwrap()))
.map(|c| {
(
c.name().to_owned(),
Self::map_glue_data_type(&c.r#type.clone().unwrap()).unwrap(),
)
})
.collect::<Vec<(String, DataType)>>();

let listing_options = ListingOptions {
Expand Down

0 comments on commit b53d2ea

Please sign in to comment.