Splice Machine Commands Reference
This guide contains reference information for using the Splice Machine command line interpreter, which is also known as the Splice Prompt (splice>).
The Using section of the guide will help you to get started, in the topics:
- Getting Started with the CLI introduces you to using the CLI.
- Command Line Syntax summarizes command line parameters and syntax.
- Scripting the CLI shows you how to script a set of commands to submit via the CLI.
- Using RLWrap with splice> summarizes the RLWrap commands you can use to enhance the CLI.
The remainder of this guide contains a reference topic page for each Splice Machine command. As shown in the tables below, you can use many of the commands when connected in any way (including JDBC and ODBC) to Splice Machine, while some commands can only be used via our command line interpreter.
Commands You Can Use with All Connections to a Splice Machine Database
The following table summarizes the commands that you can use them with the
sqlshell interface in our On-Premise Database and Database-as-Service products, and also with programs that connect to a Splice Machine database using JDBC or ODBC, including the Zeppelin notebook interface in our Database Service.
|Analyze||Collects statistics for a table or schema.||splice> analyze table myTable;
splice> analyze schema myschema;
|Autocommit||Turns the connection's auto-commit mode on or off.||splice> autocommit off;|
|Export||Exports query results to binary files.||splice> EXPORT_BINARY('/my/export/dir', true, 'parquet') SELECT a,b,sqrt(c) FROM t1 WHERE a > 100;|
|Commit||Commits the currently active transaction and initiates a new transaction.||splice> commit;|
|Execute||Executes an SQL prepared statement or SQL command string.||splice> execute 'insert into myTable(id, val) values(?,?)' ;|
|Explain||Displays the execution plan for an SQL statement.||splice> explain select count(*) from si;|
|Export||Exports query results to CSV files.||splice> EXPORT('/my/export/dir', null, null, null, null, null) SELECT a,b,sqrt(c) FROM join t2 on t1.a=t2.a;|
|Prepare||Creates a prepared statement for use by other commands.||splice> prepare seeMenu as 'SELECT * FROM menu';|
|Release Savepoint||Releases a savepoint.||splice> release savepoint gSavePt1;|
|Remove||Removes a previously prepared statement.||splice> remove seeMenu;|
|Rollback||Rolls back the currently active transaction and initiates a new transaction.||splice> rollback;|
|Rollback to Savepoint||Rolls the current transaction back to the specified savepoint.||splice> rollback to savepoint gSavePt1;|
|Savepoint||Creates a savepoint within the current transaction.||splice> savepoint gSavePt1;|
Commands You Can Only Use with Our Command Line Interface (
The following table sunmmarizes the commands that you can only use with
the splice> command line interface (
our On-Premise Database and Database-as-Service products.
|Connect||Connect to a database via its URL.||splice> connect 'jdbc:splice://xyz:1527/splicedb';|
|Describe||Displays a description of a table or view.||splice> describe myTable;|
|Disconnect||Disconnects from a database.||splice> disconnect SPLICE;|
|Elapsedtime||Enables or disables display of elapsed time for command execution.||splice> elapsedtime on;|
|Exit||Causes the command line interface to exit.||splice> exit;|
|Help||Displays a list of the available commands.||splice> help;|
|MaximumDisplayWidth||Sets the maximum displayed width for each column of results displayed by the command line interpreter.||splice> maximumdisplaywidth 30;|
|Run||Runs commands from a file.||splice> run myCmdFile;|
|Set Connection||Allows you to specify which connection is the current connection||splice> set connection sample1;|
|Set Session_Property||Allows you to specify default hint values for certain query hints||splice> set session_property useSpark=true;|
|Show Connections||Displays information about active connections and database objects.||splice> show connections;|
|Show Create Table||command displays the DDL used with the `create table` statement to create a specified table..||splice> show create table players;|
|Show Functions||Displays information about functions defined in the database or in a schema.||splice> show functions in splice;|
|Show Indexes||Displays information about the indexes defined on a table, a database, or a schema.||splice> show indexes from mytable;|
|Show Primary Keys||Displays information about the primary keys in a table.||splice> show primarykeys from mySchema.myTable;|
|Show Procedures||Displays information about active connections and database objects.||splice> show procedures in syscs_util;|
|Show Roles||Displays information about all of the roles defined in the database.||splice> show roles;|
|Show Schemas||Displays information about the schemas in the current connection.||splice> show schemas;|
|Show Synonyms||Displays information about the synonyms that have been created in a database or schema.||splice> show synonyms;|
|Show Tables||Displays information about all of the tables in a database or schema.||splice> show tables in SPLICE;|
|Show Views||Displays information about all of the active views in a schema.||splice> show views in SPLICE;|