Consider the following code, which simply dumps one million 2-Byte integers into a HDF5 file using HDFql:
std::string filepath = "/tmp/test.h5";
sprintf(script_, "CREATE TRUNCATE FILE %s", filepath.c_str());
HDFql::execute(script_);
sprintf(script_, "USE FILE %s", filepath.c_str());
HDFql::execute(script_);
HDFql::execute("CREATE CHUNKED DATASET data AS SMALLINT(UNLIMITED)");
const int data_size = 1000000;
std::vector<uint16_t> data(data_size);
HDFql::variableRegister(&data[0]);
for(int i=0; i<data_size; i++) {data.at(i)=i;}
sprintf(script_, "ALTER DIMENSION data TO +%d", num_data-1);
HDFql::execute(script_);
sprintf(script_, "INSERT INTO data(-%d:1:1:%d) VALUES FROM MEMORY 0", 0, num_data);
HDFql::execute(script_);
Since HDF5 is an efficient binary method of storing data, I'd expect this file size to be around 1E6*2 ~ 2MB big. Instead the file size is ~40MB! That's around 20 times larger than you'd expect. I found this after using HDFql to convert one binary format to HDF5, the resulting HDF5 files were way bigger than the original binary. Does anyone know what's going on here?
Many thanks!