Closed skatsuta closed 7 years ago
Done.
Create result pipeliner to abstract channels regardless of whether or not --order
flag is given, and have Athenai
hold it.
I struggle to design it, pending to implement.
feature/add-order-flag
branch holds WIP code.
Number each query execution and call send(num, resultContainer)
to return a query result.
At receipt part, in case rc := <-a.pipe.ResultContainer():
check rc.Err()
and rc.Result()
to get the result or error.
Must create resultChs and errChs every time doing RunQuery
.
There is a bug where query executions of fewer statements are stuck after several statements are executed when --order
flag is given.
$ time go run main.go run --order
athenai> SELECT date, time, bytes, requestip, method, status FROM cloudfront_logs LIMIT 5; SHOW TABLES; SHOW DATABASES; SELECT timestamp, requestip, backendip FROM elb_logs LIMIT 5;
â ž Running query...
(snip)
Run time: 2.05 seconds | Data scanned: 101.27 KB
athenai> SHOW TABLES;
(snip)
Run time: 0.34 seconds | Data scanned: 0 B
â ´ Running query... ^C^C^C (Stuck and ^C does not work)
I finally decided I remove --order
and always show all query results in the same order as queries.
See 7ee9eac543251a75e32485e44b7e185c69593e90