Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Dec 10, 2024
1 parent 97963d8 commit 0daa0aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/query/service/src/sessions/query_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ pub struct QueryContext {
// Used by synchronized generate aggregating indexes when new data written.
inserted_segment_locs: Arc<RwLock<HashSet<Location>>>,
target_segment_locs: Arc<DashMap<SegmentIndex, Location>>,
// Temp table for materialized CTE, first string is the database_name, second string is the table_name
// All temp tables' catalog is `CATALOG_DEFAULT`, so we don't need to store it.
m_cte_temp_table: Arc<RwLock<Vec<(String, String)>>>,
}

impl QueryContext {
Expand All @@ -180,6 +183,7 @@ impl QueryContext {
inserted_segment_locs: Arc::new(RwLock::new(HashSet::new())),
block_threshold: Arc::new(RwLock::new(BlockThresholds::default())),
target_segment_locs: Arc::new(DashMap::new()),
m_cte_temp_table: Arc::new(Default::default()),
})
}

Expand Down
3 changes: 0 additions & 3 deletions src/query/sql/src/planner/binder/ddl/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1283,16 +1283,13 @@ impl Binder {
_hilbert_index \
"
);

let tokens = tokenize_sql(query.as_str())?;
let (stmt, _) = parse_sql(&tokens, self.dialect)?;
let Statement::Query(query) = &stmt else {
unreachable!()
};
let mut new_bind_context = BindContext::new();
let (s_expr, new_bind_context) = self.bind_query(&mut new_bind_context, query)?;
// Wrap `LogicalMaterializedCte` to `s_expr`
let s_expr = new_bind_context.cte_context.wrap_m_cte(s_expr);
let new_bind_context = Box::new(new_bind_context);
bind_context.parent = Some(new_bind_context.clone());
let cluster_by = OptimizeClusterBy {
Expand Down

0 comments on commit 0daa0aa

Please sign in to comment.