-
Notifications
You must be signed in to change notification settings - Fork 45
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
getTags vs. getFields #260
Comments
Please add versions of the library and influxdb version used. Is there a minimal example to reproduce the issue? The related test case might be a good starting point, but does not show the problem. |
I'm using InfluxDB v1.6.7~rc0 and influxcxx v0.7.1 Please see the below for the example that reproduce the said issue. #include <InfluxDBFactory.h>
#include <iostream>
#include <chrono>
#include <string>
#include <vector>
influxdb::Point makeSinglePoint() {
influxdb::Point toReturn{"BENCH_DB"};
std::chrono::time_point<std::chrono::system_clock> timestamp(std::chrono::milliseconds(946684800));
toReturn.setTimestamp(timestamp);
for (int i = 1; i < 32; i++) {
toReturn.addField("col" + std::to_string(i - 1), "asdf" + std::to_string(i));
}
return toReturn;
}
int main(int argc, char const *argv[])
{
// Init InfluxDB instances
auto db = influxdb::InfluxDBFactory::Get("http://192.168.1.155:8086?db=BENCH_DB");
// Create DB
db->createDatabaseIfNotExists();
// Make single Point
influxdb::Point currPoint = makeSinglePoint();
// Insert
db->write(std::move(currPoint));
// Query
std::vector<influxdb::Point> unaryQueryRep = db->query("SELECT * FROM BENCH_DB WHERE time = 946684800ms");
std::cout << unaryQueryRep.at(0).getFields() << "\n";
} |
Thanks, I'm able to reproduce the issue with your example. |
The original implementation uses the type to determine field (everything except string) or tag (string). The response JSON doesn't provide any information to separate field and tag strings, but only columns and values. |
Not sure if I understand it correctly but it seems that the getTags call is returning Field instead of tags.
This was validated using Influx CLI client:
CMD:
CMD Returns:
getTags: When calling
getTags
, it's returning fields shown inCMD
. However, callinggetFields
, it's not returning anything.The text was updated successfully, but these errors were encountered: