Class GPUdbRecordType
Represent the data type for a given record in GPUdb. Has convenience functions for creating the type in GPUdb (among others).
Create a GPUdbRecordType object which represents the data type for a given record for GPUdb.
Parameters
A list of GPUdbRecordColumn objects. Either this argument or the schema_string argument must be given.
Optional string label for the column.
The JSON string containing the schema for the type. Either this argument or the columns argument must be given.
Optional dict that lists the properties for the columns of the type. Meant to be used in conjunction with schema_string only; will be ignored if columns is given.
A list of columns for the record type.
A list of the names of the columns for the record type.
A label for the record type.
The schema string for the record type.
The bare column definition for the record type, as the compact JSON list of [name, type] pairs that the server’s request_schema_str insertion option expects; a column that is nullable carries a third “nullable” entry.
Only the base (avro) type of each column is listed–any sub-type or other property, such as ‘timestamp’ or ‘char8’, is left out, since this describes the payload being sent rather than the table it is being sent to.
Declaring this on an insertion tells the server which columns the records actually carry. A column of the target table that is absent from the list is populated by the server from its own default value (‘default’, ‘init_with_now’ or ‘init_with_uuid’), which is how a record can omit a column altogether.
The avro schema for the record type.
The RecordType object for the record type.
The properties for the type’s columns.
The ID for the type, if it has already been registered with GPUdb.
Create the record type in GPUdb so that users can create tables using this type.
Parameters
A GPUdb object to connect to a GPUdb server.
Optional dictionary containing options for the /create/type call.
Returns
The type ID.
Return the desired column; fetch by name or index.
Parameters
If string, then the name of the column. If an integer, then the index of the column. Must be a valid column name or be within bounds.
Returns
The GPUdbRecordColumn object pertaining to the desired column.