Class DataFrameUtils
Create a pd.Dataframe from the results of a SQL query.
Parameters
a GPUdb instance
the SQL query
the query parameters. Defaults to None.
the batch size for the SQL execution results. Defaults to BATCH_SIZE.
the SQL options as a dict. Defaults to None.
whether to display progress or not. Defaults to False.
Raises
If the SQL query failed
Returns
a Pandas pd.Dataframe or None if the SQL query has returned no results
Convert a Kinetica table into a pd.Dataframe and load data into it.
Parameters
a GPUdb instance
name of the Kinetica table
the batch size for the SQL execution results. Defaults to BATCH_SIZE.
whether to display progress or not. Defaults to False.
Returns
Returns a Pandas pd.Dataframe created from the Kinetica table
Convert the type schema (column list) of a GPUdbTable into a pd.Dataframe.
Parameters
a GPUdbTable instance
Returns
a Pandas pd.Dataframe created by analyzing the table column types
Load a pd.Dataframe into a table; optionally dropping any existing table, creating it if it doesn’t exist, and loading data into it; and then returning a GPUdbTable reference to the table.
Parameters
The Pandas pd.Dataframe to load into a table
GPUdb instance
Name of the target Kinetica table for the pd.Dataframe loading
Optional Kinetica column properties to apply to the column type definitions inferred from the pd.Dataframe; map of column name to a list of column properties for that column, excluding the inferred base type. Defaults to empty map. For example:
Whether to drop an existing table of the same name or not before creating this one. Defaults to False.
Whether to create the table if it doesn’t exist or not. Defaults to True.
Whether to load data into the target table or not. Defaults to True.
Whether to show progress of the operation on the console. Defaults to False.
The number of records at a time to load into the target table. Defaults to BATCH_SIZE.
Raises
If the pd.Dataframe is empty, the table doesn’t exist and create_table is False, or the data ingest fails
Returns
a GPUdbTable instance created from the pd.Dataframe passed in
Load a Pandas pd.Dataframe into a GPUdbTable.
Parameters
a Pandas pd.Dataframe
a GPUdbTable instance
a batch size to use for loading data into the table. Defaults to BATCH_SIZE.
whether to show progress of the operation. Defaults to False.
Raises
If the data ingest fails
Returns
the number of rows of the pd.Dataframe actually inserted into the Kinetica table