SET SESSION_PROPERTY

The SET SESSION_PROPERTY command sets or unsets specific session-level property values. Session-level properties assign an initial value to certain Splice Machine query hints, which allows you to supply the hint by default in all queries.

This command should only be used by advanced users. Query hints are very powerful, and applying them by default can lead to unforeseen and unfortunate consequences.

Syntax

SET SESSION_PROPERTY {
   propertySetting [, propertySetting]*
}

propertySetting

useSpark  = [true | false | null]

Splice Machine will include additional session properties in the future.

Usage

Specifying a hint in a query overrides the session-level property setting. For example, if you use this command to tell Splice Machine to use Spark to process every query in the session:

SET SESSION_PROPERTY useSpark=true

and then submit a query with the hint:

--splice-properties useSpark=false

That query will run on the control side (using HBase), and not on Spark. Other, unhinted queries will continue to assume the useSpark=true default hint value.

The following table summarizes the currently available session properties:

Session Property Description
useSpark

Setting this to true is equivalent to having the useSpark=true hint applied by default for every query.

Setting this to false is equivalent to specifying the useSpark=false hint applied by default for every query.

Setting this to null unsets the property, which is equivalent to not specifying the useSpark=false hint by default in any query.

Unsetting a Property

To unset a session property, assign null as its value.

Displaying Current Session Properties

You can use the values current session_property expression to display the current session_property values. Note that only properties that you have explicitly set to non-null values are displayed.

Examples

Here’s an example of setting a session property:

splice> set session_property useSpark=true;
0 rows inserted/updated/deleted
splice> values current session_property;
1
------------------------------------------------------------------
USESPARK=true;

1 row selected

And here’s an example of unsetting those values (resetting them to their connection default values):

splice> set session_property useSpark=null;
0 rows inserted/updated/deleted
splice> values current session_property;
1
------------------------------------------------------------------


1 row selected

See Also