(
expr: &SqlExpr,
row: &[Value],
column_index: &HashMap<String, usize>,
)
| 159 | // ── Argument evaluation (pub(super) for value_agg) ──────────────────────────── |
| 160 | |
| 161 | pub(super) fn eval_arg_for_row( |
| 162 | expr: &SqlExpr, |
| 163 | row: &[Value], |
| 164 | column_index: &HashMap<String, usize>, |
| 165 | ) -> Value { |
| 166 | match expr { |
| 167 | SqlExpr::Column(name) => column_index |
| 168 | .get(name.as_str()) |
| 169 | .and_then(|&idx| row.get(idx)) |
| 170 | .cloned() |
| 171 | .unwrap_or(Value::Null), |
| 172 | SqlExpr::Literal(v) => v.clone(), |
| 173 | other => { |
| 174 | let doc = row_to_obj(row, column_index); |
| 175 | other.eval(&doc) |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | fn row_to_obj(row: &[Value], column_index: &HashMap<String, usize>) -> Value { |
| 181 | let mut map = HashMap::new(); |
no test coverage detected