Skip to content

fix(tesseract): Using FULL JOIN for outer aggregate joins in BigQuery #9605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: tesseract-filters-over-proxy-time-dims
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ export class BigqueryQuery extends BaseQuery {
templates.types.decimal = 'BIGDECIMAL({{ precision }},{{ scale }})';
templates.types.binary = 'BYTES';
templates.expressions.cast_to_string = 'CAST({{ expr }} AS STRING)';
templates.operators.is_not_distinct_from = 'IS NOT DISTINCT FROM';
templates.join_types.full = 'FULL';
templates.statements.time_series_select = 'SELECT DATETIME(TIMESTAMP(f)) date_from, DATETIME(TIMESTAMP(t)) date_to \n' +
'FROM (\n' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ impl PhysicalPlanBuilderContext {

pub struct PhysicalPlanBuilder {
query_tools: Rc<QueryTools>,
_plan_sql_templates: PlanSqlTemplates,
plan_sql_templates: PlanSqlTemplates,
}

impl PhysicalPlanBuilder {
pub fn new(query_tools: Rc<QueryTools>) -> Self {
let plan_sql_templates = query_tools.plan_sql_templates();
Self {
query_tools,
_plan_sql_templates: plan_sql_templates,
plan_sql_templates,
}
}

Expand Down Expand Up @@ -464,17 +464,14 @@ impl PhysicalPlanBuilder {
let on = JoinCondition::new_dimension_join(conditions, true);
let next_alias = format!("q_{}", i);

join_builder.inner_join_source(join.clone(), next_alias, on);

/* TODO: Full join fails even in BigQuery, where it’s theoretically supported. Disabled for now — needs investigation.
if full_key_aggregate.use_full_join_and_coalesce
&& self.plan_sql_templates.supports_full_join()
{
join_builder.full_join_source(join.clone(), next_alias, on);
} else {
// TODO in case of full join is not supported there should be correct blending query that keeps NULL values
join_builder.inner_join_source(join.clone(), next_alias, on);
} */
&& self.plan_sql_templates.supports_full_join()
{
join_builder.full_join_source(join.clone(), next_alias, on);
} else {
// TODO in case of full join is not supported there should be correct blending query that keeps NULL values
join_builder.inner_join_source(join.clone(), next_alias, on);
}
}

let result = From::new_from_join(join_builder.build());
Expand Down
Loading