We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
description:
现在的实现虽然能过测例,但是有问题,重新捋一下
理想中的解析顺序:
关于提取表达式,提取的目的是为了让上层算子能拿到想要的数据,取决于具体实现:
PS:
和现有实现相比:
The text was updated successfully, but these errors were encountered:
根据捋完的结果,写一份大致的伪代码: 各部分处理各自的语义解析,在函数内部完成,检查逻辑一样的话可以复用检查函数
auto tables, table_map auto normal_check_func = [tables, table_map] (expr) { ... } rc = process_from_clause(from_relations, tables, table_map, normal_check_func) -> join_tables rc = create_filter_stmt(conditions, normal_check_func) -> filter_stmt rc = create_groupby_stmt(groupbys, normal_check_func) -> groupby_stmt, groupby_exprs auto normal_check_with_groupby = [tables, table_map, groupby_exprs] (expr) { ... } rc = create_filter_stmt(havings, normal_check_with_groupby) -> having_stmt, aggr_exprs, field_exprs_not_in_aggr if (groupby_stmt) { groupby_stmt->add_exprs(aggr_exprs, field_exprs_not_in_aggr) } rc = create_orderby_stmt(orderbys, normal_check_with_groupby) -> orderby_stmt, aggr_exprs, field_exprs_not_in_aggr if (groupby_stmt) { groupby_stmt->add_exprs(aggr_exprs, field_exprs_not_in_aggr) } rc = process_project_clause(projects, normal_check_with_groupby) -> project_exprs, aggr_exprs, field_exprs_not_in_aggr if (groupby_stmt) { groupby_stmt->add_exprs(aggr_exprs, field_exprs_not_in_aggr) } if (orderby_stmt) { orderby_stmt->add_exprs(aggr_exprs, field_exprs_not_in_aggr) } return select_stmt(join_tables, filter_stmt, groupby_stmt, having_stmt, orderby_stmt, project_exprs)
create_groupby_stmt(groupbys, normal_check_func) { rc = groupbys.for_each(traverse_check(normal_check_func)) return groupby_stmt(groupbys, orderby_stmt(groupbys)) } groupby_stmt::add_exprs(aggr_exprs, field_exprs_not_in_aggr) { this->add_aggr_exprs(aggr_exprs) this->add_field_exprs(field_exprs_not_in_aggr) this->orderby_stmt->add_field_exprs(field_exprs_not_in_aggr) this->orderby_stmt->add_field_exprs(extract_field_exprs(aggr_fields)) }
时间有限,想法可能也不完善,就不重构这边了
Sorry, something went wrong.
No branches or pull requests
description:
现在的实现虽然能过测例,但是有问题,重新捋一下
理想中的解析顺序:
关于提取表达式,提取的目的是为了让上层算子能拿到想要的数据,取决于具体实现:
PS:
和现有实现相比:
The text was updated successfully, but these errors were encountered: