Library settings

The following functions define the behavior of the library

Logging and progress bars

set_progress(how)[source]

Enables or disables the progress bars for the loading, writing and downloading of datasets

Parameters:how – True if you want the progress bar, False otherwise
Returns:None

Example:

import gmql as gl

gl.set_progress(True)   # abilitates progress bars
# ....do something...
gl.set_progress(False)  # removes progress bars
# ....do something...

Execution Mode

set_mode(how)[source]

Sets the behavior of the API

Parameters:how – if ‘remote’ all the execution is performed on the remote server; if ‘local’ all it is executed locally. Default = ‘local’
Returns:None

Master Configuration

set_master(master: str)[source]

Set the master of the PyGMQL instance. It accepts any master configuration available in Spark.

Parameters:master – master configuration
Returns:None
get_configuration()[source]

Returns the configurations of the current PyGMQL instance

Returns:a Configuration object
set_spark_configs(d)[source]

Set Spark configurations to be used during the spark-submit. Works only when the master is different from local.

Parameters:d – a dictionary of {key: values}
Returns:None
set_local_java_options(options: list)[source]

When the mode is set to local, this function can be used to add JVM specific options before starting the backend. It accepts any Java option.

Parameters:options – list of string, one for each Java option
Returns:None

Remote Management

get_remote_manager()[source]

Returns the current remote manager

Returns:a RemoteManager
login()[source]

Enables the user to login to the remote GMQL service. If both username and password are None, the user will be connected as guest.

logout()[source]

The user can use this command to logout from the remote service

Returns:None
set_remote_address(address)[source]

Enables the user to set the address of the GMQL remote service

Parameters:address – a string representing the URL of GMQL remote service
Returns:None