Closed wmalpica closed 4 years ago
Add tests for item 1, 4 in json_transform_tree in ral Add tests for item 2, 3 in pyblazing with pytest Add run pytest in test.sh Modularize conversion code from Logical Plan Optimizen to Json, add module in pyblazing algebra
Add support for:
e.g. Now is valid
// Base case
LogicalJoin(condition=[=($6, $0)], joinType=[left])
LogicalJoin(condition=[=($3, $1)], joinType=[left])
LogicalTableScan(table=[[main, product]])
LogicalTableScan(table=[[main, client]])
LogicalTableScan(table=[[main, preference]])\n
// Without \n end logical plan
LogicalJoin(condition=[=($6, $0)], joinType=[left])
LogicalJoin(condition=[=($3, $1)], joinType=[left])
LogicalTableScan(table=[[main, product]])
LogicalTableScan(table=[[main, client]])
LogicalTableScan(table=[[main, preference]])
// Multiple \n
LogicalJoin(condition=[=($6, $0)], joinType=[left])
LogicalJoin(condition=[=($3, $1)], joinType=[left]) \n\n\n\n
LogicalTableScan(table=[[main, product]])
LogicalTableScan(table=[[main, client]]) \n\n\n\n
LogicalTableScan(table=[[main, preference]])\n
// Empty lines
LogicalJoin(condition=[=($6, $0)], joinType=[left])
LogicalJoin(condition=[=($3, $1)], joinType=[left])
LogicalTableScan(table=[[main, product]])
LogicalTableScan(table=[[main, client]])
LogicalTableScan(table=[[main, preference]])\n
// End with one or multiples spaces or tabs
LogicalJoin(condition=[=($6, $0)], joinType=[left]) // end of line spaces
LogicalJoin(condition=[=($3, $1)], joinType=[left])\t\t\t\t\t // end of lines tabs
LogicalTableScan(table=[[main, product]]) \t \t // end of line mix of spaces and tabs
LogicalTableScan(table=[[main, client]])
LogicalTableScan(table=[[main, preference]])\n
// Differente type indentation
LogicalJoin(condition=[=($6, $0)], joinType=[left])
\tLogicalJoin(condition=[=($3, $1)], joinType=[left]) // detect one tab as indentation by default. Level 1
\t\tLogicalTableScan(table=[[main, product]]) // level 2
\t\tLogicalTableScan(table=[[main, client]]) // level 2
\tLogicalTableScan(table=[[main, preference]])\n // level 1
LogicalJoin(condition=[=($6, $0)], joinType=[left])
\t \tLogicalJoin(condition=[=($3, $1)], joinType=[left]) // detect '\t \t' (tab space tab) as indentation by default Level 1
\t \t\t \tLogicalTableScan(table=[[main, product]]) // level 2
\t \t\t \tLogicalTableScan(table=[[main, client]]) // level 2
\t \tLogicalTableScan(table=[[main, preference]])\n // level 1
LogicalJoin(condition=[=($6, $0)], joinType=[left])
LogicalJoin(condition=[=($3, $1)], joinType=[left]) // detect ' ' (three spaces) as indentation by default
\tLogicalTableScan(table=[[main, product]]) // invalid indentation, throw exception
LogicalTableScan(table=[[main, client]])
LogicalTableScan(table=[[main, preference]])\n
We want to create some unit tests for the
transform_json_tree
function inPhysicalPlanGenerator.h
The unit tests should be of the form:
The tests should be:
1 should work. 2 will hopefully work. I believe there may be an issue with situation 3. We should fix the code so that this is not an issue.
A relational algebra plan for a query with a window function would look like this: