Add p0 test cases, including:
aggregate
join
union
order by
group by
keyword
arithmetic operators
logical operators
case function
coalesce
between
in
like
limit
where
regexp
window function
runtime filter
schema change
In row mode schema change, it will fail sometime because memory exceeded.
When the left memory is enough for sorting but not enough for next block,
it will not flush row_block_arr which data in memory and continue to alloc next block
so it can't alloc the memory and return directly.
And if it can't alloc the memory for block, it need to flush row_block_arr and
try it again unless row_block_arr is empty.
Two improvements have been added:
1. Translate parquet physical type into doris logical type.
2. Decode parquet column chunk into doris ColumnPtr, and add unit tests to show how to use related API.
1. Change all required fields to optional
Although they all "required", but it not recommended to use `required`, because it is hard to modify in future.
2. Fix a missing field bug
* [bugfix](schema change) when there is a string column with delete predicate, the schema change may core
Co-authored-by: yiguolei <yiguolei@gmail.com>
1. rename PhysicalHeapSort to PhysicalQuickSort
2. add LogicalTopN and PhysicalTopN
3. add implementation rule for LogicalTopN
4. add a interface Sort for both logical and physical sort
5. add a interface TopN for both logical and physical top-n
6. add a AbstractPhysicalSort as super class of PhysicalQuickSort and PhysicalTopN
When we do write current plan with its child. Currently, nereids memo do nothing indeed.
This PR fix this situation by add a predicate in rewrite that only replaced target group and set newGroupExpressionGenerated to false when target is null or target is same with existed group expression's group.
here we need to handle one situation that original target is not the same with
existedGroupExpression.getOwnerGroup(). In this case, if we change target to
existedGroupExpression.getOwnerGroup(), we could not rewrite plan as we expected and the plan
will not be changed anymore.
Think below example:
We have a plan like this:
```
Original (Group 2 is root):
Group2: Project(outside)
Group1: |---Project(inside)
Group0: |---UnboundRelation
and we want to rewrite group 2 by Project(inside, GroupPlan(group 0))
After rewriting we should get (Group 2 is root):
Group2: Project(inside)
Group0: |---UnboundRelation
Group1: Project(inside)
```
After rewriting, Group 1's GroupExpression is not in GroupExpressionsMap anymore and Group 1 is unreachable.
Merge Group 1 into Group 2 is better, but in consideration of there is others way to let a Group take into
unreachable. There's no need to complicate to add a merge step. Instead, we need to have a clear step to
remove unreachable groups and GroupExpressions after rewrite.
1. add StatementContext, and PlannerContext is renamed to CascadsContext. CascadsContext belong to a StatementContext, and StatementContext belong to a ConnectionContext, and the lifecycle increases in turn. StatementContext can wrap some statement's lifecycle-related state, such as ExpressionId, TableLock. MemoTestUtil can simplify create a CascadesContext and Memo for test.
2. add PlanPreprocessor to process parsed logical plan before copy into memo. and add a PlanPostprocessor to process physical plan after copy out from memo.
3. utilize PlanPreprocessor to process SET_VAR hint, the class is EliminateLogicalSelectHint
4. pass the limit clause in regression test case, in set_var.groovy