Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordworms committed Feb 18, 2024
1 parent e351b07 commit b090c19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions datafusion/core/src/datasource/listing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ mod tests {

Ok(())
}

#[cfg(feature = "parquet")]
#[tokio::test]
async fn load_table_stats_by_default() -> Result<()> {
Expand Down
9 changes: 3 additions & 6 deletions datafusion/sql/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,16 +502,13 @@ pub fn object_name_to_table_reference(
let ObjectName(idents) = object_name;
idents_to_table_reference(idents, enable_normalization)
}
pub fn substitute_tilde(cur: String) -> String {
fn substitute_tilde(cur: String) -> String {
if let Ok(usr_dir) = env::var("HOME") {
if cur.starts_with('~') {
cur.replacen('~', &usr_dir, 1)
} else {
cur
return cur.replacen('~', &usr_dir, 1);
}
} else {
cur
}
cur
}
/// Create a [`OwnedTableReference`] after normalizing the specified identifier
pub(crate) fn idents_to_table_reference(
Expand Down

0 comments on commit b090c19

Please sign in to comment.