airflow.contrib.hooks.pinot_hook

Module Contents

class airflow.contrib.hooks.pinot_hook.PinotDbApiHook(*args, **kwargs)[source]

Bases:airflow.hooks.dbapi_hook.DbApiHook

Connect to pinot db(https://github.com/linkedin/pinot) to issue pql

conn_name_attr = pinot_broker_conn_id[source]
default_conn_name = pinot_broker_default[source]
supports_autocommit = False[source]
get_conn(self)[source]

Establish a connection to pinot broker through pinot dbqpi.

get_uri(self)[source]

Get the connection uri for pinot broker.

e.g: http://localhost:9000/pql

get_records(self, sql)[source]

Executes the sql and returns a set of records.

Parameters

sql (str) – the sql statement to be executed (str) or a list of sql statements to execute

get_first(self, sql)[source]

Executes the sql and returns the first resulting row.

Parameters

sql (str or list) – the sql statement to be executed (str) or a list of sql statements to execute

set_autocommit(self, conn, autocommit)[source]
get_pandas_df(self, sql, parameters=None)[source]
insert_rows(self, table, rows, target_fields=None, commit_every=1000)[source]