MCPcopy Create free account
hub / github.com/apache/datafusion / documented_rules

Function documented_rules

datafusion/core/src/optimizer_rule_reference.rs:24–52  ·  view source on GitHub ↗
(section_heading: &str)

Source from the content-addressed store, hash-verified

22const OPTIMIZER_RULE_REFERENCE: &str = include_str!("optimizer_rule_reference.md");
23
24fn documented_rules(section_heading: &str) -> Vec<String> {
25 let mut in_section = false;
26 let mut names = vec![];
27
28 for line in OPTIMIZER_RULE_REFERENCE.lines() {
29 if line == section_heading {
30 in_section = true;
31 continue;
32 }
33
34 if in_section && line.starts_with("### ") {
35 break;
36 }
37
38 if !in_section || !line.starts_with('|') || line.contains("---") {
39 continue;
40 }
41
42 let columns: Vec<_> = line.split('|').map(str::trim).collect();
43
44 if columns.len() < 4 || columns[1] == "order" {
45 continue;
46 }
47
48 names.push(columns[2].trim_matches('`').to_string());
49 }
50
51 names
52}
53
54#[test]
55fn analyzer_rules_match_documented_order() {

Callers

nothing calls this directly

Calls 7

collectMethod · 0.80
containsMethod · 0.45
mapMethod · 0.45
splitMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…