GitHub user zuyu reopened a pull request: https://github.com/apache/incubator-quickstep/pull/271
QUICKSTEP-95: Fixed the exception due to zero tuple estimation for th⦠â¦e empty project expression. The problem is that [tuple_slot_bytes_](https://github.com/apache/incubator-quickstep/blob/master/storage/SplitRowStoreTupleStorageSubBlock.cpp#L128) is ZERO if the project expression is empty, and [later](https://github.com/apache/incubator-quickstep/blob/master/storage/SplitRowStoreTupleStorageSubBlock.cpp#L142) results in a divide-by-zero exception. It is easy to reproduce: ``` $ create table r (a int, b char(20)); $ insert into r values(1, 'madison'); $ create table s (a int, c float); $ select s.a from r, s where r.a > 0; ``` ``` I0619 18:26:45.097215 1944100864 PhysicalGenerator.cpp:196] Optimized physical plan: TopLevelPlan +-plan=NestedLoopsJoin | +-left=Selection | | +-input=TableReference[relation=r] | | | +-AttributeReference[id=0,name=a,relation=r,type=Int] | | | +-AttributeReference[id=1,name=b,relation=r,type=Char(20)] | | +-filter_predicate=Greater | | | +-AttributeReference[id=0,name=a,relation=r,type=Int] | | | +-Literal[value=0,type=Int] | | +-project_expressions= | | +-[] | +-right=TableReference[relation=s] | | +-AttributeReference[id=2,name=a,relation=s,type=Int] | | +-AttributeReference[id=3,name=c,relation=s,type=Float] | +-join_predicate=Literal[value=true] | +-project_expressions= | +-AttributeReference[id=2,name=a,relation=s,type=Int] +-output_attributes= +-AttributeReference[id=2,name=a,relation=s,type=Int] ``` Floating point exception: 8 You can merge this pull request into a Git repository by running: $ git pull https://github.com/zuyu/incubator-quickstep quickstep-95 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-quickstep/pull/271.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #271 ---- commit eb128ce3e6ae9e7dce5d7c4f05ca1f712640ac7d Author: Zuyu Zhang <zu...@apache.org> Date: 2017-06-19T20:53:52Z QUICKSTEP-95: Fixed the exception due to zero tuple estimation for the empty project expression. ---- ---