vmware-archive / quickstep

Quickstep Project
Apache License 2.0
27 stars 13 forks source link

Print number of rows in the output #219

Closed hbdeshmukh closed 8 years ago

hbdeshmukh commented 8 years ago

Sample output on a table with only one column and two rows:

quickstep> select * from r;
+-----------+
|id         |
+-----------+
|          3|
|          5|
+-----------+
( 2 rows )
Time: 2.315 ms
quickstep> select count(*) from r;
+--------------------+
|count(*)            |
+--------------------+
|                   2|
+--------------------+
( 1 rows )
Time: 0.879 ms
quickstep> select count(*) from r where r.id < 4;
+--------------------+
|count(*)            |
+--------------------+
|                   1|
+--------------------+
( 1 rows )
Time: 0.879 ms
quickstep> select count(*) from r where r.id < 2;
+--------------------+
|count(*)            |
+--------------------+
|                   0|
+--------------------+
( 1 rows )
Time: 0.748 ms

I also tried running queries on larger tables and it worked correctly.

hbdeshmukh commented 8 years ago

Cancelled the travis build for another commit.

hbdeshmukh commented 8 years ago

Minor change in the output formatting:

quickstep> select count(*) from r;
+--------------------+
|count(*)            |
+--------------------+
|                   2|
+--------------------+
(1 row)
Time: 2.281 ms
quickstep> select * from r;
+-----------+
|id         |
+-----------+
|          3|
|          5|
+-----------+
(2 rows)
Time: 0.719 ms
pateljm commented 8 years ago

LGTM. Merging.