Operational Commands
Reference of GridGain SQL operational commands — COPY INTO, SET STREAMING, KILL QUERY, KILL CONTINUOUS, and the legacy COPY command.
COPY INTO
Description
Imports data from an external source into a table or exports data to a file from the table. The table the data is imported into must exist.
COPY FROM source
INTO target
FORMAT formatType
[ formatTypeOptions ]
[ PROPERTIES ( 'propName'='propValue' [,...]) ]Parameters
source- the full path to the file to import the data data from (iftargetis a table). Then name of the table and the list of columns to export the data from (iftargetis a file). If the source is a table, you can further narrow down the selection by using a query.target- the table and table columns when importing data to the table. The path to the file when exporting data.formatType- the format of the file to work with:CSVPARQUETICEBERG
properties- case-sensitive configuration properties:s3.client-region- when using S3 storage, the region to store the data in.s3.access-key-id- when using S3 storage, the AWS access key. Optional. If you omit boths3.access-key-idands3.secret-access-key, the default AWS credentials provider is used.s3.secret-access-key- when using S3 storage, the AWS secret key. Optional, but must be specified ifs3.access-key-idis specified.s3.endpoint- when using S3 storage, overrides the S3 endpoint URL. Set this to use an S3-compatible service instead of AWS S3.For Iceberg format:
The catalog properties are supported.
The
table-identifierproperty describes Apache Iceberg TableIdentifier names. The names can be dot-separated. For example,db_name.table_nameortable.The Apache Iceberg
warehousepath can be defined explicitly as a'warehouse'='path'property, or implicitly as a source/targetCOPY FROM source INTO target. If both ways are defined, the explicit property is used.
formatTypeOptions- parameters related to the selected file format:delimiter- the field delimiter for CSV files; default delimiter is,. Delimiter syntax is'char'. Any alphanumeric character can be a delimiter.header- for CSV files only; if set totrue, specifies that the created file should contain a header line with column names. Column names of the table are used to create the header line.pattern- the file pattern used when importing partitioned Parquet tables in the regular expression format. The regular expression must be enclosed in'signs. For example,'.*'imports all files. Partitioned column will not be imported.
Examples
Import data from columns name and age of a CSV file with header into Table1 columns name and age:
Import data from the first two columns of a CSV file without header into Table1 columns name and age:
Export data from Table1 to a CSV file:
Export data from Table1 to a CSV file:
Import CSV file from AWS S3 into Table1:
A simple example of exporting data to Iceberg. For working with local file system you can use HadoopCatalog that does not need to connect to a Hive MetaStore.
Export data into Iceberg on AWS S3:
Imports data from partitioned Parquet database:
Where the Parquet table looks like this:
SET STREAMING
Description
Streams data in bulk to an SQL table in your GridGain cluster. When streaming is enabled, the JDBC/ODBC driver packs your commands in batches and sends them to the server (GridGain cluster). On the server side, the batch is converted into a stream of cache update commands, which are distributed asynchronously between the server nodes. Performing this asynchronously increases peak throughput because at any given time all cluster nodes are busy with data loading.
Usage
To stream data into your GridGain cluster, prepare a file with the SET STREAMING ON command followed by INSERT commands for the data to be loaded. For example:
Known Limitations
While streaming mode allows you to load data much faster than other data loading techniques, it has some limitations:
Only
INSERTcommands are allowed; any attempt to executeSELECTor any other DML or DDL command will cause an exception.Due to streaming mode's asynchronous nature, you cannot know update counts for every statement executed; all JDBC/ODBC commands returning update counts will return 0.
Example
Use the world.sql file that is shipped with the latest GridGain distribution. It can be found in the {gridgain_dir}/examples/sql/ directory. You can use the run command from SQLLine, as shown below:
After executing the above command and closing the JDBC connection, all data will be loaded into the cluster and ready to be queried.

KILL QUERY
Description
Cancel a running query. When a query is canceled with the KILL command, all parts of the query running on all other nodes are canceled too.
Parameters
ASYNC- an optional parameter, which returns control immediately without waiting for the cancellation to finishquery_id- retrieved via the SQL_QUERIES system view
KILL CONTINUOUS
Description
Cancel a running continuous query.
Parameters
node_id- the id of the source node of the continuous query. Retrieved via the CONTINUOUS_QUERIES system view.routine_id- the continuous query ID. retrieved via the CONTINUOUS_QUERIES system view.
COPY
Copy data from a CSV file into a SQL table.
Parameters
'/path/to/local/file.csv'- the actual path to the CSV filetableName- the name of the table to copy the data tocolumnName- the name of a column corresponding to a column in the CSV file
Example
In the above command, substitute /path/to/local/file.csv with the actual path to your CSV file. For instance, you can use city.csv that is shipped with the latest GridGain distribution. You can find it in your {gridgain_dir}/examples/src/main/resources/sql/ directory.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

