Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coprocessor: select response of dag don't need row meta. #2302

Merged
merged 25 commits into from Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
593d477
coprocessor: select response of dag don't need row meta.
winoros Sep 12, 2017
3462bbd
don't send group by key if there isn't
winoros Sep 15, 2017
0bdea39
Merge branch 'master' into yiding/handle
winoros Sep 15, 2017
92f2ffa
format code
winoros Sep 15, 2017
d104ed1
Merge branch 'master' into yiding/handle
winoros Sep 15, 2017
eb18d46
Merge branch 'master' into yiding/handle
AndreMouche Sep 18, 2017
9d4175f
modify tests
winoros Sep 20, 2017
7396b28
Merge branch 'yiding/handle' of https://github.com/pingcap/tikv into …
winoros Sep 20, 2017
6ce44f5
Merge branch 'master' into yiding/handle
winoros Sep 20, 2017
8764374
Merge branch 'master' into yiding/handle
AndreMouche Sep 21, 2017
f1bd8d7
Merge branch 'yiding/handle' of https://github.com/pingcap/tikv into …
winoros Sep 21, 2017
23ea73d
address comments
winoros Sep 21, 2017
ac31337
Merge branch 'master' into yiding/handle
AndreMouche Sep 21, 2017
dfe3880
Merge branch 'master' into yiding/handle
AndreMouche Sep 22, 2017
c51fc53
Merge branch 'master' into yiding/handle
winoros Sep 22, 2017
d2c2b8b
address comment
winoros Sep 22, 2017
6d03f79
address some comments
winoros Sep 25, 2017
b50cd01
Merge branch 'master' into yiding/handle
AndreMouche Sep 25, 2017
069d253
make it correct.
winoros Sep 26, 2017
bf589ae
Merge branch 'yiding/handle' of https://github.com/pingcap/tikv into …
winoros Sep 26, 2017
5397f69
address comment
winoros Sep 26, 2017
abf6183
Merge branch 'master' into yiding/handle
hicqu Sep 26, 2017
e20d356
Merge branch 'master' into yiding/handle
shenli Sep 27, 2017
c32c139
Merge branch 'master' into yiding/handle
winoros Sep 27, 2017
fb0c7ec
Merge branch 'master' into yiding/handle
AndreMouche Sep 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/coprocessor/dag/dag.rs
Expand Up @@ -15,7 +15,7 @@ use std::rc::Rc;

use tipb::executor::{ExecType, Executor};
use tipb::schema::ColumnInfo;
use tipb::select::{DAGRequest, RowMeta, SelectResponse};
use tipb::select::{DAGRequest, SelectResponse};
use kvproto::coprocessor::{KeyRange, Response};
use protobuf::{Message as PbMsg, RepeatedField};

Expand Down Expand Up @@ -67,7 +67,6 @@ impl<'s> DAGContext<'s> {
Ok(Some(row)) => {
try!(self.req_ctx.check_if_outdated());
let chunk = get_chunk(&mut chunks);
let length = chunk.get_rows_data().len();
if self.has_aggr {
chunk.mut_rows_data().extend_from_slice(&row.data.value);
} else {
Expand All @@ -78,10 +77,6 @@ impl<'s> DAGContext<'s> {
));
chunk.mut_rows_data().extend_from_slice(&value);
}
let mut meta = RowMeta::new();
meta.set_handle(row.handle);
meta.set_length((chunk.get_rows_data().len() - length) as i64);
chunk.mut_rows_meta().push(meta);
}
Ok(None) => {
let mut resp = Response::new();
Expand Down
4 changes: 3 additions & 1 deletion src/coprocessor/dag/executor/aggregation.rs
Expand Up @@ -143,7 +143,9 @@ impl<'a> Executor for AggregationExecutor<'a> {
let value_size = group_key.len() + approximate_size(&aggr_cols, false);
let mut value = Vec::with_capacity(value_size);
box_try!(value.encode(aggr_cols.as_slice(), false));
value.extend_from_slice(group_key);
if !self.group_by.is_empty() {
value.extend_from_slice(group_key);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems different with aggregation in select ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there is no group by column, group_key is redundant, and since we no longer transfer rowMeta, redundant value shouldn't be sent to tidb.

}
self.cursor += 1;
Ok(Some(Row {
handle: 0,
Expand Down