GitHub user zuyu opened a pull request:
https://github.com/apache/incubator-quickstep/pull/349
Fixed the bug regarding EliminateEmptyNode and Analyze command.
This PR fixed a bug introduced in #342. The problem was that that rule does
not distinguish between an analyze command and an aggregate query. Thus, both
reduces into a `SELECT` query on a temp table. Ironically,
`quickstep_cli_tests_commandexecutor_analyze` does not proof the correctness of
the rule because `\analyze` has no effect under the rule and no stats added.
In other words, we could easily reproduce the bug:
```
CREATE TABLE r (a int);
\analyze r
SELECT COUNT(*) FROM r; // this produce nothing (in 0 row), instead of a
ZERO (in 1 row).
```
This fix adds a flag for `\analyze` command, and also transforms an
aggregate query correctly.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zuyu/incubator-quickstep
elimination-rule-bug-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-quickstep/pull/349.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 #349
----
commit 8cd618cd5d8d2ea2a7383fb9d4be65227807b60d
Author: Zuyu Zhang <zuyu@...>
Date: 2018-05-03T01:24:01Z
Fixed the bug regarding EliminateEmptyNode and Analyze command.
----
---