Skip to content

Commit

Permalink
feat: view exploitation (#19)
Browse files Browse the repository at this point in the history
* feat: view exploitation

* add PruneCandidates physical optimizer
  • Loading branch information
suremarc authored Jan 3, 2025
1 parent cf65d79 commit ed61143
Show file tree
Hide file tree
Showing 7 changed files with 608 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ futures = "0.3"
itertools = "0.13"
log = "0.4"
object_store = "0.11"
ordered-float = "4.6.0"

[dev-dependencies]
anyhow = "1.0.95"
Expand Down
2 changes: 1 addition & 1 deletion src/materialized/file_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ impl std::fmt::Debug for FileMetadataExec {
.field("plan_properties", &self.plan_properties)
.field("filters", &self.filters)
.field("limit", &self.limit)
.finish()
.finish_non_exhaustive()
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/materialized/row_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ impl std::fmt::Debug for RowMetadataRegistry {
.map(|r| (r.key().clone(), r.value().name().to_string()))
.collect::<BTreeMap<_, _>>(),
)
.field(
"default_source",
&self.default_source.as_ref().map(|s| s.name()),
)
.finish()
}
}
Expand Down
20 changes: 20 additions & 0 deletions src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,24 @@
// specific language governing permissions and limitations
// under the License.

use datafusion::{common::extensions_options, config::ConfigExtension};

/// Implements a query rewriting optimizer, also known as "view exploitation"
/// in some academic sources.
pub mod exploitation;

pub mod normal_form;

mod util;

extensions_options! {
/// Options for the query rewriting optimizer
pub struct QueryRewriteOptions {
/// Toggle query rewriting on or off
pub enabled: bool, default = true
}
}

impl ConfigExtension for QueryRewriteOptions {
const PREFIX: &'static str = "QueryRewrite";
}
Loading

0 comments on commit ed61143

Please sign in to comment.