From 5db087020988e72940ab0e719bb3eadd175cb72a Mon Sep 17 00:00:00 2001 From: Richard Newman Date: Thu, 13 Apr 2017 11:45:05 -0700 Subject: [PATCH] Part 1: maintain 'with' variables in AlgebrizedQuery. --- query-algebrizer/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/query-algebrizer/src/lib.rs b/query-algebrizer/src/lib.rs index cac16009..831a0023 100644 --- a/query-algebrizer/src/lib.rs +++ b/query-algebrizer/src/lib.rs @@ -14,6 +14,8 @@ extern crate error_chain; extern crate mentat_core; extern crate mentat_query; +use std::collections::BTreeSet; + mod errors; mod types; mod validate; @@ -29,6 +31,7 @@ use mentat_query::{ FindQuery, FindSpec, SrcVar, + Variable, }; pub use errors::{ @@ -41,6 +44,7 @@ pub use errors::{ pub struct AlgebraicQuery { default_source: SrcVar, pub find_spec: FindSpec, + pub with: BTreeSet, has_aggregates: bool, pub limit: Option, pub cc: clauses::ConjoiningClauses, @@ -96,6 +100,7 @@ pub fn algebrize_with_cc(schema: &Schema, parsed: FindQuery, mut cc: ConjoiningC default_source: parsed.default_source, find_spec: parsed.find_spec, has_aggregates: false, // TODO: we don't parse them yet. + with: parsed.with.into_iter().collect(), limit: limit, cc: cc, })