Skip to content

Commit ed61143

Browse files
authored
feat: view exploitation (#19)
* feat: view exploitation * add PruneCandidates physical optimizer
1 parent cf65d79 commit ed61143

File tree

7 files changed

+608
-5
lines changed

7 files changed

+608
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ futures = "0.3"
4545
itertools = "0.13"
4646
log = "0.4"
4747
object_store = "0.11"
48+
ordered-float = "4.6.0"
4849

4950
[dev-dependencies]
5051
anyhow = "1.0.95"

src/materialized/file_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ impl std::fmt::Debug for FileMetadataExec {
412412
.field("plan_properties", &self.plan_properties)
413413
.field("filters", &self.filters)
414414
.field("limit", &self.limit)
415-
.finish()
415+
.finish_non_exhaustive()
416416
}
417417
}
418418

src/materialized/row_metadata.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ impl std::fmt::Debug for RowMetadataRegistry {
4343
.map(|r| (r.key().clone(), r.value().name().to_string()))
4444
.collect::<BTreeMap<_, _>>(),
4545
)
46+
.field(
47+
"default_source",
48+
&self.default_source.as_ref().map(|s| s.name()),
49+
)
4650
.finish()
4751
}
4852
}

src/rewrite.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,24 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
use datafusion::{common::extensions_options, config::ConfigExtension};
19+
20+
/// Implements a query rewriting optimizer, also known as "view exploitation"
21+
/// in some academic sources.
22+
pub mod exploitation;
23+
1824
pub mod normal_form;
25+
26+
mod util;
27+
28+
extensions_options! {
29+
/// Options for the query rewriting optimizer
30+
pub struct QueryRewriteOptions {
31+
/// Toggle query rewriting on or off
32+
pub enabled: bool, default = true
33+
}
34+
}
35+
36+
impl ConfigExtension for QueryRewriteOptions {
37+
const PREFIX: &'static str = "QueryRewrite";
38+
}

0 commit comments

Comments
 (0)