BlazingContext()

BlazingContext is the Python API of BlazingSQL. Along with initialization arguments, the BlazingContext class has a number of methods which assist not only in creating and querying tables, but also in connecting remote data sources and understanding your ETL.

You must establish a BlazingContext to connect to a BlazingSQL instance to create tables, run queries, and basically do anything with BlazingSQL. First, import the required libraries.

from blazingsql import BlazingContext

bc = BlazingContext()

Constructor

BlazingContext([dask_client, …])

BlazingContext is the Python API of BlazingSQL.

Managing tables

BlazingContext.create_table(table_name, …)

Create a BlazingSQL table.

BlazingContext.drop_table(table_name)

Drop table from BlazingContext memory.

BlazingContext.describe_table(table_name)

Returns a dictionary with the names of all the columns and their types for the specified table.

BlazingContext.list_tables()

Returns a list with the names of all created tables.

BlazingContext.partition(input[, by])

BlazingContext.add_remove_table(tableName, …)

Querying tables

BlazingContext.sql(query[, algebra, …])

Query a BlazingSQL table.

BlazingContext.explain(sql[, detail])

Returns break down of a given query’s Logical Relational Algebra plan.

BlazingContext.fetch(token)

BlazingContext.status(token)

Ancillary methods

BlazingContext.do_progress_bar(arg, …)

BlazingContext.get_free_memory()

This function returns a dictionary which contains as key the gpuID and as value the free memory (bytes)

BlazingContext.get_max_memory_used()

This function returns a dictionary which contains as key the gpuID and as value the max memory (bytes)

BlazingContext.reset_max_memory_used()

This function resets the max memory usage counter to 0