Skip to content

Commit

Permalink
fix: added commnets for num of rows and failure if output is not of a…
Browse files Browse the repository at this point in the history
…ffecetd rows
  • Loading branch information
Lilit0x committed Oct 19, 2023
1 parent 02fdcf5 commit 62a251a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/instance/opentsdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl OpentsdbProtocolHandler for Instance {
.check_permission(ctx.current_user(), PermissionReq::Opentsdb)
.context(AuthSnafu)?;

let (requests, no_of_rows) = data_point_to_grpc_row_insert_requests(data_points)?;
let (requests, _) = data_point_to_grpc_row_insert_requests(data_points)?;
let output = self
.handle_row_inserts(requests, ctx)
.await
Expand All @@ -47,7 +47,7 @@ impl OpentsdbProtocolHandler for Instance {

Ok(match output {
common_query::Output::AffectedRows(rows) => rows,
_ => no_of_rows,
_ => unreachable!(),
})
}
}
3 changes: 2 additions & 1 deletion src/servers/src/opentsdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ pub fn data_point_to_grpc_row_insert_requests(
let tags = data_point.tags().clone();
let value = data_point.value();
let timestamp = data_point.ts_millis();
//length of tags + 1 extra column for greptime_timestamp
let num_columns = tags.len() + 1;

let table_data = multi_table_data.get_or_default_table_data(table_name, num_columns, 0);
let table_data = multi_table_data.get_or_default_table_data(table_name, num_columns, 1);
let mut one_row = table_data.alloc_one_row();

//tags
Expand Down

0 comments on commit 62a251a

Please sign in to comment.