1

I have some question on the usability of HDFql:

  1. Does HDFql support created of a table where the row are of different type?
  2. How do you append data to the table?
  3. How do you iterate though the row do the table?

The table I want to create will have any thing 1 to 2^n rows and cannot be determine before hand.

Johan
  • 575
  • 5
  • 21

1 Answers1

2

Here goes some info concerning your questions about HDFql:

  1. If by "HDFql support created of a table where the row are of different type" you mean HDFql supports compound data type, the answer is not yet. (EDIT: since HDFql version 2.2.0 compound data types are now supported)

  2. To append data into a dataset (where its size cannot be determined before hand), you have to go through several steps (I will assume that you are using the C programming language):

    2.1. The dataset must be extendible. As an example, you can create an extendible dataset in HDFql as follows (this creates a dataset named dset of integer data type with an unlimited size):

    hdfql_execute("CREATE CHUNKED DATASET dset AS INT(UNLIMITED)");

2.2. Write a value in the last row of dataset dset using a hyperslab as follows (replace my_value with an integer that you would like to write into the dataset):

    hdfql_execute("INSERT INTO dset(-1:1:1:1) VALUES(my_value)");

2.3. After writing a value to dataset dset and if there are more values to write, first increase (i.e. alter) the dimension one unit like the following and then repeat step 2.2.:

    hdfql_execute("ALTER DIMENSION dset TO +1");
  1. To iterate through the rows of dataset dset, you must first read it and then use function hdfql_cursor_get_int() as follows:
    hdfql_execute("SELECT FROM dset");
    while(hdfql_cursor_next(NULL) == HDFQL_SUCCESS)
    {
        printf("Value: %d\n", *hdfql_cursor_get_int(NULL));
    }
SOG
  • 876
  • 6
  • 10
  • What is the syntax for hyperslabs? Is it similar to list slicing as in python? – Mr Squid Sep 05 '19 at 05:27
  • 1
    @MrSquid, the syntax of an hyperslab in HDFql is `[start]:[stride]:[count]:[block]`. It's not exactly the same syntax of list slicing in Python. Please check section 6.6 in HDFql reference manual (http://www.hdfql.com/resources/HDFqlReferenceManual.pdf) and https://support.hdfgroup.org/HDF5/doc1.8/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDataspaces%2FHDF5_Dataspaces_and_Partial_I_O.htm%23TOC_7_4_1_Data_Selectionbc-7 for additional details about hyperslabs. – SOG Sep 05 '19 at 13:15