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

DATA-2153 - Change TabularDataByQuery API to accept list of BSON docs rather than strings #400

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions proto/viam/app/data/v1/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ message TabularDataBySQLResponse {
// TabularDataByMQLRequest requests tabular data using an MQL query.
message TabularDataByMQLRequest {
string organization_id = 1;
// mql_query accepts a MongoDB aggregation pipeline, to be run on the "sensorData.readings"
// namespace, which holds the Viam organization's tabular data.
// mql_query is deprecated.
string mql_query = 2;
// mql_binary accepts a MongoDB aggregation pipeline as a list of BSON documents, where each
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] list of serialized BSON documents?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think simply saying "BSON documents" is actually more accurate, since BSON is already in a binary/byte format - a BSON document is just a series of bytes with a particular format. You can serialize/encode objects into BSON, but saying "serialized BSON documents" to me makes it sound like we took BSON documents and serialized/encoded them further. Lmk if you disagree!

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point! Agreed.

// document is one stage in the pipeline. The pipeline is run on the "sensorData.readings"
// namespace, which holds the Viam organization's tabular data.
repeated bytes mql_binary = 3;
}

// TabularDataByMQLResponse provides unified tabular data and metadata, queried with MQL.
Expand Down
Loading