Class: Type

GPUdb.Type(label, …columns)

Metadata about a GPUdb type.

Constructor

new Type(label, …columns)

Creates a Type object containing metadata about a GPUdb type.
Parameters:
Name Type Attributes Description
label String A user-defined description string which can be used to differentiate between data with otherwise identical schemas.
columns GPUdb.Type.Column <repeatable>
The list of columns that the type comprises.
Source:

Classes

Column

Members

columns :Array.<GPUdb.Type.Column>

The list of columns that the type comprises.
Type:
Source:

label :String

A user-defined description string which can be used to differentiate between data with otherwise identical schemas.
Type:
  • String
Source:

Methods

(static) from_table(gpudb, table_name, callbackopt) → {GPUdb.Type}

Creates a Type object containing metadata about the type stored in the specified table in GPUdb.

If a callback function is provided, the metadata will be obtained asynchronously, and the result (either a Type object or an error) will be passed to the callback function upon completion.

If a callback function is not provided, the metadata will be obtained synchronously and the Type object returned directly, and an exception will be thrown if an error occurs.

Parameters:
Name Type Attributes Description
gpudb GPUdb GPUdb API object.
table_name String The table from which to obtain type metadata.
callback GPUdbCallback <optional>
The callback function, if asynchronous operation is desired.
Source:
Returns:
The Type object, if no callback function is provided.
Type
GPUdb.Type

(static) from_type(gpudb, type_id, callbackopt) → {GPUdb.Type}

Creates a Type object containing metadata about the specified type in GPUdb.

If a callback function is provided, the metadata will be obtained asynchronously, and the result (either a Type object or an error) will be passed to the callback function upon completion.

If a callback function is not provided, the metadata will be obtained synchronously and the Type object returned directly, and an exception will be thrown if an error occurs.

Parameters:
Name Type Attributes Description
gpudb GPUdb GPUdb API object.
type_id String The type for which to obtain metadata.
callback GPUdbCallback <optional>
The callback function, if asynchronous operation is desired.
Source:
Returns:
The Type object, if no callback function is provided.
Type
GPUdb.Type

(static) from_type_info(label, type_schema, properties) → {GPUdb.Type}

Creates a Type object using data returned from the GPUdb show_table or show_types endpoints.
Parameters:
Name Type Description
label String A user-defined description string which can be used to differentiate between data with otherwise identical schemas.
type_schema String | Object The Avro record schema for the type.
properties Object.<String, Array.<String>> A map of column names to lists of properties that apply to those columns.
Source:
Returns:
The Type object.
Type
GPUdb.Type

create(gpudb, callbackopt) → {String}

Creates a new type in GPUdb based on the metadata in the Type object and returns the GPUdb type ID for use in subsequent operations.

If a callback function is provided, the type will be created asynchronously, and the result (either a type ID or an error) will be passed to the callback function upon completion.

If a callback function is not provided, the type will be created synchronously and the type ID returned directly, and an exception will be thrown if an error occurs.

Parameters:
Name Type Attributes Description
gpudb GPUdb GPUdb API object.
callback GPUdbCallback <optional>
The callback function, if asynchronous operation is desired.
Source:
Returns:
The type ID, if no callback function is provided.
Type
String

generate_schema() → {Object}

Generates an Avro record schema based on the metadata in the Type object.
Source:
Returns:
The Avro record schema.
Type
Object