Version: 5.7.1
clc sql
Executes a SQL statement.
Usage:
bash
clc sql [query] [flags]
Parameters:
| Parameter | Required | Description | Default |
|---|---|---|---|
--use- | Optional | Executes the proposed CREATE MAPPING suggestion and retries the query. | false |
Global parameters
| Parameter | Description | Default |
|---|---|---|
--config, -c | Name of the configuration or path to the configuration file in YAML format. | The following locations are tried in order for the existence of
|
--format, -f | Set the output format
|
|
--log. | Set the log level, one of:
| info |
--log. | Set the log path. Use stderr to log to the screen (stderr). | $CLC_ |
--quiet, -q | Prevent displaying unnecessary output. | false |
--verbose | Enable output with more information. | false |
--timeout | Timeout for operation to complete. The duration is a string in the form of
Underscore (_) character is ignored in the The following are a few of the valid DURATIONs:
warning This is a client-side timeout, the operation you started maybe in progress on the server-side even if the given timeout is exceeded. |
Querying with SQL using the Hazelcast CLC
You can run SQL queries in both interactive and non-interactive mode of the Hazelcast CLC.
- Non-Interactive mode
- Interactive mode
bash
$ clc sql -c prod "SELECT * from cities"
---------------------------------------------------------------------------------
__key | country | city | population
---------------------------------------------------------------------------------
1 | United Kingdom | London | 9540576
4 | United States | Los Angeles | 3985520
5 | Turkey | Ankara | 5309690
7 | Brazil | Sao Paulo | 22429800
---------------------------------------------------------------------------------
bash
clc
> SELECT * FROM cities
---------------------------------------------------------------------------------
__key | country | city | population
---------------------------------------------------------------------------------
1 | United Kingdom | London | 9540576
4 | United States | Los Angeles | 3985520
5 | Turkey | Ankara | 5309690
7 | Brazil | Sao Paulo | 22429800
---------------------------------------------------------------------------------