6.1.14VARSMALLINT
The HDFql VARSMALLINT data type stores values between -32,768 and 32,767 and occupies 2 bytes in memory (per element). It represents the data type of an HDF5 (variable-length) H5T_NATIVE_SHORT dataset/attribute or of a result set that stores variable-length elements of this type (which can be retrieved using the HDFQL_CURSOR_GET_SMALLINT and HDFQL_SUBCURSOR_GET_SMALLINT functions when working with cursors). Depending on the programming language supported by HDFql, the VARSMALLINT data type is represented by:
- In C, the “short” data type.
- In C++, the “short” data type.
- In Java, the “ArrayList<Short>” class.
- In Python, the “int16” NumPy data type.
- In C#, the “Int16” data type (or corresponding alias “short”).
- In Fortran, the “INTEGER(KIND = 2)” data type.
- In R21, the “integer” data type.
- In MATLAB, the “int16” data type.
Notes
- By design, R does not provide a data type that stores values between -32,768 and 32,767 using exactly 2 bytes in memory. As a substitute, the R “integer” data type may be used, at the cost of increased memory usage (as it occupies 4 bytes of memory) and lower performance (as byte alignment must be performed by HDFql). ↩