6.7.16SHOW DIMENSION
Syntax
SHOW [MAX] DIMENSION [DATASET | ATTRIBUTE] [file_name] object_name
[post_processing_option]
[output_redirecting_option]
Description
Show (i.e. get) the dimensions of an HDF5 dataset or attribute named object_name. In case a dataset and an attribute with identical names (object_name) are stored in the same location (i.e. group) and neither the keyword DATASET nor ATTRIBUTE is specified, the dimensions returned belong to the dataset. To explicitly get the dimensions of object_name according to its type, the keyword DATASET or ATTRIBUTE must be specified. By default, the returned dimensions refer to the current dimensions of a dataset or an attribute; to return the maximum dimensions that a dataset or an attribute may grow to, the keyword MAX must be specified. If the maximum dimension is unlimited, the returned value is HDFQL_UNLIMITED.
Parameter(s)
file_name – optional string that specifies the name of the HDF5 file storing the dataset or attribute whose dimensions are to be obtained. If file_name is specified, the file is opened on the fly, the dimensions of the dataset or attribute are obtained, and the file is subsequently closed. If not specified, the file currently in use is used instead.
object_name – mandatory string that specifies the name of the HDF5 dataset or attribute whose dimensions are to be obtained.
post_processing_option – optional option that transforms the result set according to the programmer’s needs, such as ordering or truncating (please refer to the section PROCESSING for additional information).
output_redirecting_option – optional option that specifies the cursor in use, an HDF5 object (i.e. dataset or attribute), a (text, binary, or Excel) file, or memory (i.e. user-defined variable) to write the result set into (please refer to the subsection INTO for additional information). If not specified, the cursor in use is populated with the result set instead (please refer to the chapter CURSOR for additional information).
Return
The dimensions of an HDF5 dataset or attribute as an HDFQL_BIGINT or nothing (in case the dataset or attribute is a scalar – i.e. is not an array).
Example(s)
# create an HDF5 dataset named "my_dataset0" of data type unsigned int
CREATE DATASET my_dataset0 AS UNSIGNED INT
# show (i.e. get) dimensions of dataset "my_dataset0" (should return nothing)
SHOW DIMENSION my_dataset0
# show (i.e. get) maximum dimensions of dataset "my_dataset0" (should return nothing)
SHOW MAX DIMENSION my_dataset0
# create an HDF5 dataset named "my_dataset1" of data type unsigned int
CREATE DATASET my_dataset1 AS UNSIGNED INT(5)
# show (i.e. get) dimensions of dataset "my_dataset1" (should return 5)
SHOW DIMENSION my_dataset1
# show (i.e. get) maximum dimensions of dataset "my_dataset1" (should return 5)
SHOW MAX DIMENSION my_dataset1
# create an HDF5 dataset named "my_dataset2" of data type double of one dimension (size 15)
CREATE DATASET my_dataset2 AS DOUBLE(15)
# show (i.e. get) dimensions of dataset "my_dataset2" (should return 15)
SHOW DIMENSION my_dataset2
# show (i.e. get) maximum dimensions of dataset "my_dataset2" (should return 15)
SHOW MAX DIMENSION my_dataset2
# create an HDF5 attribute named "my_attribute0" of data type int of one dimension (size 1)
CREATE ATTRIBUTE my_attribute0 AS INT(1)
# show (i.e. get) dimensions of attribute "my_attribute0" (should return 1)
SHOW DIMENSION my_attribute0
# show (i.e. get) maximum dimensions of attribute "my_attribute0" (should return 1)
SHOW MAX DIMENSION my_attribute0
# create an HDF5 attribute named "my_attribute1" of data type short of two dimensions (size 2x3)
CREATE ATTRIBUTE my_attribute1 AS SMALLINT(2, 3)
# show (i.e. get) dimensions of attribute "my_attribute1" (should return 2, 3)
SHOW DIMENSION my_attribute1
# show (i.e. get) maximum dimensions of attribute "my_attribute1" (should return 2, 3)
SHOW MAX DIMENSION my_attribute1
# create an HDF5 dataset named "my_dataset3" of data type float of three dimensions (first dimension with size 2 and extendible up to 10; second dimension with size 5; third dimension with size 20 and extendible to an unlimited size)
CREATE CHUNKED DATASET my_dataset3 AS FLOAT(3 TO 10, 5, 20 TO UNLIMITED, UNLIMITED)
# show (i.e. get) dimensions of dataset "my_dataset3" (should return 3, 5, 20, 1)
SHOW DIMENSION my_dataset3
# show (i.e. get) maximum dimensions of dataset "my_dataset3" (should return 10, 5, -1, -1)
SHOW MAX DIMENSION my_dataset3