Skip to content

Commit

Permalink
Merge pull request #509 from splitgraph/fix-clade-store-cache
Browse files Browse the repository at this point in the history
Fix condition for caching clade object stores
  • Loading branch information
gruuya authored Mar 12, 2024
2 parents af67f65 + 9973793 commit 005745e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/catalog/metastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl Metastore {
})?
.clone();

if (location.starts_with("file://") || location.starts_with("memory://"))
if !(location.starts_with("file://") || location.starts_with("memory://"))
&& let Some(ref cache) = self.object_store_cache
{
// Wrap the non-local store with the caching layer
Expand Down
14 changes: 7 additions & 7 deletions tests/statements/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,11 @@ async fn test_create_table_and_insert() {
assert_batches_eq!(expected, &results);
}

// There's a regression in DF 22, where the two introspection tests fail with
// "Cannot infer common argument type for comparison operation Date64 < Timestamp(Nanosecond, None)"
// Disabling them for now.
#[cfg(feature = "remote-tables")]
#[rstest]
// #[case::postgres_schema_introspected("Postgres", true)]
#[case::postgres_schema_introspected("Postgres", true)]
#[case::postgres_schema_declared("Postgres", false)]
// #[case::sqlite_schema_introspected("SQLite", true)]
#[case::sqlite_schema_introspected("SQLite", true)]
#[case::sqlite_schema_declared("SQLite", false)]
#[tokio::test]
async fn test_remote_table_querying(
Expand Down Expand Up @@ -295,9 +292,12 @@ async fn test_remote_table_querying(

let actual_lines: Vec<&str> = formatted.trim().lines().collect();
if introspect_schema {
// TODO: Looks like not all filters get pushed down in the case of introspection
assert_contains!(
actual_lines[5],
format!("TableScan: staging.remote_table projection=[a, c, date field, e], full_filters=[staging.remote_table.date field > Utf8(\"2022-11-01\") OR staging.remote_table.c = Utf8(\"two\"), staging.remote_table.a > Int64(2) OR staging.remote_table.e < TimestampNanosecond(1667599865000000000, None)], fetch=2")
actual_lines[6],
format!(
r#"TableScan: staging.remote_table projection=[a, c, date field, e], full_filters=[staging.remote_table.date field > Date32("19297") OR staging.remote_table.c = Utf8("two")]"#
)
);
} else {
assert_contains!(
Expand Down

0 comments on commit 005745e

Please sign in to comment.