Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: minor improvement to fix coverage report status #173

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions crates/datafusion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,12 @@ impl TableProvider for HudiDataSource {
exec_builder = exec_builder.with_predicate(predicate)
}

return Ok(exec_builder.build_arc());
Ok(exec_builder.build_arc())
}
}

pub struct HudiTableFactory {}

impl Default for HudiTableFactory {
fn default() -> Self {
Self::new()
}
}

impl HudiTableFactory {
pub fn new() -> Self {
Self {}
Expand All @@ -185,6 +179,12 @@ impl HudiTableFactory {
}
}

impl Default for HudiTableFactory {
fn default() -> Self {
Self::new()
}
}

#[async_trait]
impl TableProviderFactory for HudiTableFactory {
async fn create(
Expand Down Expand Up @@ -263,13 +263,13 @@ mod tests {
"datafusion.sql_parser.enable_ident_normalization",
&ScalarValue::from(false),
);
let mut session_state = SessionStateBuilder::new()
let table_factory: Arc<dyn TableProviderFactory> = Arc::new(HudiTableFactory::default());

let session_state = SessionStateBuilder::new()
.with_default_features()
.with_config(config)
.with_table_factories(HashMap::from([("HUDI".to_string(), table_factory)]))
.build();
session_state
.table_factories_mut()
.insert("HUDI".to_string(), Arc::new(HudiTableFactory::new()));

SessionContext::new_with_state(session_state)
}
Expand Down
Loading