Skip to content

Commit 2600a6d

Browse files
committed
fix td symbol deps
1 parent 6f963a7 commit 2600a6d

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

rust/cubesqlplanner/cubesqlplanner/src/planner/sql_evaluator/symbols/time_dimension_symbol.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ impl TimeDimensionSymbol {
6060
self.alias_suffix.clone()
6161
}
6262

63-
pub fn get_dependencies(&self) -> Vec<Rc<MemberSymbol>> {
64-
self.base_symbol.get_dependencies()
65-
}
66-
6763
pub fn owned_by_cube(&self) -> bool {
6864
self.base_symbol.owned_by_cube()
6965
}
@@ -94,8 +90,28 @@ impl TimeDimensionSymbol {
9490
.collect()
9591
}
9692

93+
pub fn get_dependencies(&self) -> Vec<Rc<MemberSymbol>> {
94+
let mut deps = vec![];
95+
if let Some(granularity_obj) = &self.granularity_obj {
96+
if let Some(calendar_sql) = granularity_obj.calendar_sql() {
97+
calendar_sql.extract_symbol_deps(&mut deps);
98+
}
99+
}
100+
101+
deps.append(&mut self.base_symbol.get_dependencies());
102+
deps
103+
}
104+
97105
pub fn get_dependencies_with_path(&self) -> Vec<(Rc<MemberSymbol>, Vec<String>)> {
98-
self.base_symbol.get_dependencies_with_path()
106+
let mut deps = vec![];
107+
if let Some(granularity_obj) = &self.granularity_obj {
108+
if let Some(calendar_sql) = granularity_obj.calendar_sql() {
109+
calendar_sql.extract_symbol_deps_with_path(&mut deps);
110+
}
111+
}
112+
113+
deps.append(&mut self.base_symbol.get_dependencies_with_path());
114+
deps
99115
}
100116

101117
pub fn cube_name(&self) -> String {
@@ -107,6 +123,12 @@ impl TimeDimensionSymbol {
107123
}
108124

109125
pub fn is_reference(&self) -> bool {
126+
if let Some(granularity_obj) = &self.granularity_obj {
127+
if granularity_obj.calendar_sql().is_some() {
128+
return false;
129+
}
130+
}
131+
110132
self.base_symbol.is_reference()
111133
}
112134

0 commit comments

Comments
 (0)