HDFql Reference Manual v2.6.0

6.2.3BOTTOM

Syntax

BOTTOM {bottom_value | {, subbottom_value} | {bottom_value, subbottom_value}}

Description

Truncate a result set after position bottom_value from the bottom. In other words, all elements before position bottom_value are discarded from the result set. Additionally, if the result set is of data type HDFQL_CHAR, HDFQL_VARTINYINT, HDFQL_UNSIGNED_VARTINYINT, HDFQL_VARSMALLINT, HDFQL_UNSIGNED_VARSMALLINT, HDFQL_VARINT, HDFQL_UNSIGNED_VARINT, HDFQL_VARBIGINT, HDFQL_UNSIGNED_VARBIGINT, HDFQL_VARFLOAT, HDFQL_VARDOUBLE, or HDFQL_OPAQUE, the result subset can be truncated from the bottom by specifying subbottom_value.

Parameter(s)

bottom_value – optional integer that specifies the position of the truncation of a result set from the bottom. If negative, the BOTTOM option behaves as the TOP option with a positive bottom_value.

subbottom_value – optional integer that specifies the position of the truncation of a result set from the bottom. If negative, the BOTTOM option behaves as the TOP option with a positive subbottom_value. Of note, this parameter is only applicable to a result set of one of the aforementioned data types and is ignored otherwise.

Return

The result set and/or subset is truncated from the bottom according to the specified position.

Example(s)

# create an HDF5 dataset named "my_dataset0" of data type float of four dimensions (size 5x8x4x7)
CREATE DATASET my_dataset0 AS FLOAT(5, 8, 4, 7)

# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with these (should return 5, 8, 4, 7)
SHOW DIMENSION my_dataset0

# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with the bottommost (i.e. last) dimension (should return 7)
SHOW DIMENSION my_dataset0 BOTTOM 1

# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with the two bottommost dimensions (should return 4, 7)
SHOW DIMENSION my_dataset0 BOTTOM 2

# show (i.e. get) dimensions of dataset "my_dataset0" and populate cursor in use with the two topmost dimensions (should return 5, 8)
SHOW DIMENSION my_dataset0 BOTTOM -2

# create an HDF5 dataset named "my_dataset1" of data type variable-length int of one dimension (size 3) with initial values of 12, 14, and 16 for the first position, 18 for the second position, and 20, 22, 24, and 26 for the third position
CREATE DATASET my_dataset1 AS VARINT(3) VALUES((12, 14, 16), (18), (20, 22, 24, 26))

# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with it (should return 12, 14, 16, 18, 20, 22, 24, 26)
SELECT FROM my_dataset1

# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with values of the bottommost (i.e. last) position (should return 20, 22, 24, 26)
SELECT FROM my_dataset1 BOTTOM 1

# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with values of the two bottommost positions (should return 14, 16, 18, 24, 26)
SELECT FROM my_dataset1 BOTTOM , 2

# select (i.e. read) data from dataset "my_dataset1" and populate cursor in use with the bottommost value of the two topmost positions (should return 16, 18)
SELECT FROM my_dataset1 BOTTOM -2, 1