SQL Query

Reference documentation

class dataikuapi.dss.sqlquery.DSSSQLQuery(client, query, connection, database, dataset_full_name, pre_queries, post_queries, type, extra_conf, script_steps, script_input_schema, script_output_schema, script_report_location, read_timestamp_without_timezone_as_string, read_date_as_string)

A connection to a database or database-like on which queries can be run through DSS

get_schema()

Get the query’s result set’s schema

Returns:
the schema as a JSON array of columns
iter_rows()

Get the query’s results

Returns:
an iterator over the rows, each row being a tuple of values. The order of values in the tuples is the same as the order of columns in the schema returned by get_schema
verify()

Verify that the result set streaming completed successfully and was not truncated

Raises:
if the query failed at some point while streaming the results, an exception will be raised. If the call completes without exception, then the query was successfully streamed