Basic API#

To begin your querying session, get a connection to the EvaDB using connect:

connect([evadb_dir, sql_backend])

Connects to the EvaDB server and returns a connection object.

from evadb import connect
conn = connect()

You can then use this connection to run queries:

conn.load("online_video.mp4", "youtube_video", "video").df()
conn.query("CREATE TABLE IF NOT EXISTS youtube_video_text AS SELECT SpeechRecognizer(audio) FROM youtube_video;").df()

Warning

It is important to call df to run the actual query.

EvaDB uses a lazy query execution technique to improve performance. Calling conn.query("...") will only construct and not run the query. Calling conn.query("...").df() will both construct and run the query.

EvaDBConnection Interface#

cursor()

Retrieves a cursor associated with the connection.

EvaDBCursor Interface#

connect([evadb_dir, sql_backend])

Connects to the EvaDB server and returns a connection object.

load(file_regex, table_name, format, **kwargs)

Loads data from files into a table.

query(sql_query)

Executes a SQL query.

table(table_name[, chunk_size, chunk_overlap])

Retrieves data from a table in the database.

create_udf(udf_name[, if_not_exists, ...])

Create a udf in the database.

create_vector_index(index_name, table_name, ...)

Creates a vector index using the provided expr on the table.

df()

Returns the result as a pandas DataFrame.

drop_table(table_name[, if_exists])

Drop a table in the database.

drop_udf(udf_name[, if_exists])

Drop a udf in the database.

drop_index(index_name[, if_exists])

Drop an index in the database.

EvaDBQuery Interface#

select(expr)

Projects a set of expressions and returns a new EvaDBQuery.

cross_apply(expr, alias)

Execute a expr on all the rows of the relation

filter(expr)

Filters rows using the given condition.

df()

Execute and fetch all rows as a pandas DataFrame

alias(alias)

Returns a new Relation with an alias set.

limit(num)

Limits the result count to the number specified.

order(order_expr)

Reorder the relation based on the order_expr

show()

Execute and fetch all rows as a pandas DataFrame

sql_query()

Get the SQL query that is equivalent to the relation

execute()

Transform the relation into a result set