This is an automated email from the ASF dual-hosted git repository.
xushiyan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 8bf3ee0 refactor: minor improvement to fix coverage report status
(#173)
8bf3ee0 is described below
commit 8bf3ee0550ccdd0dd3d20692becd7fab7686e118
Author: Shiyan Xu <[email protected]>
AuthorDate: Mon Oct 14 12:16:46 2024 -1000
refactor: minor improvement to fix coverage report status (#173)
---
crates/datafusion/src/lib.rs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/crates/datafusion/src/lib.rs b/crates/datafusion/src/lib.rs
index 9ef4070..6dbc624 100644
--- a/crates/datafusion/src/lib.rs
+++ b/crates/datafusion/src/lib.rs
@@ -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 {}
@@ -185,6 +179,12 @@ impl HudiTableFactory {
}
}
+impl Default for HudiTableFactory {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
#[async_trait]
impl TableProviderFactory for HudiTableFactory {
async fn create(
@@ -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)
}