Skip to content

Commit

Permalink
refactor(cubesql): Turn extend_values to generic, get params by value
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Dec 18, 2024
1 parent f8f5d10 commit 16fb906
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rust/cubesql/cubesql/src/compile/engine/df/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ impl SqlQuery {
index
}

pub fn extend_values(&mut self, values: &Vec<Option<String>>) {
self.values.extend(values.iter().cloned());
pub fn extend_values(&mut self, values: impl IntoIterator<Item = Option<String>>) {
self.values.extend(values.into_iter());
}

pub fn replace_sql(&mut self, sql: String) {
Expand Down Expand Up @@ -969,7 +969,7 @@ impl CubeScanWrapperNode {
.await?;

let (sql_string, new_values) = subquery_sql.unpack();
sql.extend_values(&new_values);
sql.extend_values(new_values);
// TODO why only field 0 is a key?
let field = subquery.schema().field(0);
subqueries_sql.insert(field.qualified_name(), sql_string);
Expand Down Expand Up @@ -1044,7 +1044,7 @@ impl CubeScanWrapperNode {
)
.await?;
let (subq_sql_string, new_values) = subq_sql.sql.unpack();
sql.extend_values(&new_values);
sql.extend_values(new_values);
let subq_alias = subq_sql.from_alias;
// Expect that subq_sql.column_remapping already incorporates subq_alias/
// TODO does it?
Expand Down

0 comments on commit 16fb906

Please sign in to comment.