You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@quickstep.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/14 03:38:00 UTC
[jira] [Commented] (QUICKSTEP-95) Exception raised if the project
expressions of a node in a query plan is empty
[ https://issues.apache.org/jira/browse/QUICKSTEP-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16165675#comment-16165675 ]
ASF GitHub Bot commented on QUICKSTEP-95:
-----------------------------------------
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.
----
> Exception raised if the project expressions of a node in a query plan is empty
> ------------------------------------------------------------------------------
>
> Key: QUICKSTEP-95
> URL: https://issues.apache.org/jira/browse/QUICKSTEP-95
> Project: Apache Quickstep
> Issue Type: Bug
> Components: Storage
> Reporter: Zuyu Zhang
>
> 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;
> {noformat}
> 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]
> {noformat}
> Floating point exception: 8
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)