'memory problems after reading HDFQL_VARIABLE_LENGTH
I'm trying to read data represented as a set of variable long bytes.I can't figure out what I'm doing wrong.
HDFql::execute("CREATE TRUNCATE CHUNKED DATASET inclusion AS UNSIGNED VARTINYINT(UNLIMITED)");
//padding with values
hdfql_execute("SELECT FROM inclusion");
auto count_row = HDFql::cursorGetCount();
std::vector<HDFQL_VARIABLE_LENGTH> result;
std::vector<HDFQL_VARIABLE_LENGTH> my_data(1);
for(auto i=0;i < count_row-1;++i)
{
int number = HDFql::variableRegister(&my_data[0]);
if(i==0)
{
scriptst << "SELECT FROM inclusion INTO MEMORY " << number;
}
else
{
scriptst << "SELECT FROM inclusion(" << i <<":::1) INTO MEMORY " << number;
}
status = HDFql::execute(scriptst);
scriptst.str(std::string());
scriptst.clear();
HDFql::variableUnregister(&my_data);
result.push_back(my_data[0]);
}
In this version, reading occurs on the 1st line and the result is added as expected. But if you replace the vector with a variable to get the result from hdfql, then the entire stack in memory collapses, the variable for the number of lines goes away, everything is broken in the resulting block too. I mean if replace:
std::vector<HDFQL_VARIABLE_LENGTH> my_data(2); --> HDFQL_VARIABLE_LENGTH my_data;
result.push_back(my_data);
- In addition, i would like to clarify the correct understanding of hyperslab: x - from what position we read if 0 then it should be empty, y - how much to read ->> inclusion(x:?:?:y)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
