Using the Jupyter Client

To start the Jupyter notebook:

jupyter notebook

To activate the RAW magic in a given notebook, type the following in a cell:

[1]: %load_ext raw_magic

List of Jupyter Magics

Queries

query

Executes a query, displays the result as a table.

Type: line and cell magic

Syntax:

%query <single line expression>

or

%%query [none|trace|debug|warn|info]
<multi line expression>

Examples:

%query select * from ["hello", "world"]
%%query
select * from [(a:1, b:[(c:"hello1", d: "world"),
                        (c:"hello2", d: "world")])]
%%query debug
select * from [(a:1, b:[(c:"hello1", d: "world"),
                        (c:"hello2", d: "world")])]

rql

Alias for query

query_as_sql

Executes a query using standard SQL compatibility layer.

Type: line and cell magic

Syntax:

%query_as_sql <single line expression>

or

%%query_as_sql [none|trace|debug|warn|info]
<multi line expression>

Examples:

%query_as_sql select * from t1
%%query_as_sql
select * from t1
        inner join t2 on t1.id = t2.id
%%query_as_sql  debug
select * from t1
        inner join t2 on t1.id = t2.id

sql

Executes a query using standard SQL compatibility layer.

Alias for query_as_sql

log

Changes global log level for queries, defaults to ‘none’

Type: line magic

Syntax:

%log (none|trace|debug|warn|info)

query_validate

Validates a query.

Type: line and cell magic

Syntax:

%query_validate <single line expression>

or

%%query_validate
<multi line expression>

Examples:

%query_validate select * from ["hello", "world"]
%%query_validate
select * from [(a:1, b:[(c:"hello1", d: "world"),
                        (c:"hello2", d: "world")])]

Views

view

Creates a view.

Type: line and cell magic

Syntax:

%view <view name>, <single line expression>

or

%%view <view name>
<multi line expression>

Examples:

%view hello, select * from ["hello", "world"]
%%view hello2
select * from [(a:1, b:[(c:"hello1", d: "world"),
                        (c:"hello2", d: "world")])]

views_drop

Deletes a view.

Type: line magic

Syntax:

%views_drop <view name>

Example:

%views_drop hello

views_list

List all views.

Type: line magic

Syntax:

%views_list

views_show

Shows information about a view.

Type: line magic

Syntax:

%views_show <view name>

Example:

%view_show hello

materialized_view

Creates a materialized view.

Type: line and cell magic

Syntax:

%materialized_view <view name>, <single line expression>

or

%%materialized_view <view name>
<multi line expression>

materialized_views_drop

Deletes a materialized view.

Type: line magic

Syntax:

%materialized_view_drop <view name>

materialized_views_list

List all materialized views.

Type: line magic

Syntax:

%materialized_views_list

materialized_views_show

Shows information about a materialized view.

Type: line magic

Syntax:

%materialized_views_show <view name>

Example:

%materialized_view_show hello

Packages

package

Creates a package.

Type: line and cell magic

Syntax:

%package <package name>, <single line expression>

or

%%package <package name>
<multi line expression>

Examples:

%package hello, foo(a: int) := a +1;
%%package hello
foo(a: int) := a +1;
bar (a: int, b: double) := {
    a + b
};

data := select * from [(a:1, b:[(c:"hello1", d: "world"),
                        (c:"hello2", d: "world")])];

packages_drop

Deletes a package.

Type: line magic

Syntax:

%packages_drop <package name>

Example:

%package_delete hello

packages_list

List all packages.

Type: line magic

Syntax:

%packages_list

packages_show

Shows information about a package.

Type: line magic

Syntax:

%package_show <package name>

Example:

%package_show hello

Buckets

buckets_list

List registered S3 buckets.

Type: line magic

Syntax:

%bucket_list

buckets_show

Shows information about a registered S3 bucket, displays the result as a json string.

Type: line magic

Syntax:

%buckets_show <bucket name>

Example:

%bucket_show some-bucket

buckets_register

Registers a S3 bucket.

Type: line magic

Syntax:

%buckets_register <bucket name>
[region: <region>]
[access_key: <access_key>]
[secret_key: <secret_key>]]

Example:

%buckets_register public-bucket eu-west-1
%buckets_register private-bucket
region: eu-west-1
access_key: 1234abcd
secret_key: 5678efgh

buckets_unregister

Unregisters a S3 bucket.

Type: line magic

Syntax:

%buckets_unregister <bucket name>

Example:

%buckets_unregister some-bucket

Relational Databases Servers

rdbms_list

List registered RDBMS servers.

Type: line magic

Syntax:

%rdbms_list

rdbms_show

Shows information about a registered RDBMS server.

Type: line magic

Syntax:

%rdbms_show <server name>

Example:

%rdbms_show some-database-server

rdbms_register

Registers a RDBMS server.

Type: cell magic

Syntax:

%%rdbms_register <name>
type: (posgresql|mysql|sqlserver|oracle|teradata)
host: <host>
[database: <database>]
[port: <port>]
[username: <username>]
[password: <password>]
[parameters: <parameters>] // only for teradata databases

Example:

%%rdbms_register my_pg_server
type: postgresql
host: www.pg_server.com
database: my_database
username: john
password: hunter3

rdbms_unregister

Unregisters an RDBMS server.

Type: line magic

Syntax:

%rdbms_unregister <name>

Example:

%rdbms_unregister my_server

HTTP Credentials

http_auth_list

List registered HTTP credentials.

Type: line magic

Syntax:

%http_auth_list

http_auth_show

Shows information about a registered HTTP auth credentials.

Type: line magic

Syntax:

%http_auth_show <http url>

Example:

%http_auth_show https://www.somewhere.com

HDFS Delegation Tokens

hdfs_token_register

Registers or replaces a HDFS delegation token.

Type: line magic

Syntax:

%hdfs_token_register <token>

Example:

%hdfs_token_register 1234

hdfs_token_unregister

Unregisters a HDFS delegation token.

Type: line magic

Syntax:

%hdfs_token_unregister

hdfs_token_show

Shows registered HDFS delegation token.

Type: line magic

Syntax:

%hdfs_token_show

Status Information

health

Shows health information about the raw-server.

Type: line magic

Syntax:

%health

creds_health

Shows health information about the credentials-server.

Type: line magic

Syntax:

%creds_health

raw_version

Shows the version of the raw server.

Syntax:

%raw_version