Skip to content

Commit 26858c7

Browse files
Merge pull request #2 from griddb/5.5-rc
Update for 5.5
2 parents 60c806b + 0c09888 commit 26858c7

12 files changed

Lines changed: 645 additions & 56 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The GridDB CLI provides command line interface tool to manage GridDB cluster ope
1111
Building and program execution are checked in the environment below.
1212

1313
OS: CentOS 7.9(x64)
14-
GridDB Server: V5.3 CE(Community Edition)
15-
Java: Java™ SE Development Kit 11 (OpenJDK 11.0.19)
14+
GridDB Server: V5.5 CE(Community Edition)
15+
Java: OpenJDK 1.8.0
1616

1717
## Quick start from CLI Source Code
1818

Specification_en.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,89 @@ Set whether to execute count query when SQL querying.
14731473
[Memo]
14741474
- If FALSE is specified, the response will be faster instead of displaying no hit count. The execution time is not affected by this setting.
14751475

1476+
1477+
### Query result display format setting
1478+
1479+
Set the result display format before executing SQL or TQL statements.
1480+
1481+
- Sub-command
1482+
1483+
| |
1484+
| -------------------------- |
1485+
| setresultformat \<FORMAT\> |
1486+
1487+
- Argument
1488+
1489+
| Argument | Note |
1490+
| ---------- | ------------------------------------ |
1491+
| FORMAT | The result format is to be displayed. Can be set to `TABLE` or `CSV`. Default is `TABLE`.|
1492+
1493+
- Example
1494+
1495+
```example
1496+
gs[public]> sql SELECT '1+1' AS expr, '2' AS ans;
1497+
1 results. (4 ms)
1498+
gs[public]> get
1499+
+------+-----+
1500+
| expr | ans |
1501+
+------+-----+
1502+
| 1+1 | 2 |
1503+
+------+-----+
1504+
The 1 results had been acquired.
1505+
gs[public]>
1506+
```
1507+
1508+
\[Memo\]
1509+
1510+
- Display format is always CSV when EXPLAIN is executed.
1511+
1512+
### Set maximum width for display table
1513+
1514+
Set the maximum width for column in query result if the format is TABLE.
1515+
When setting the max width to column, the overflow text will be displayed with three trailing dots `...`.
1516+
1517+
- Sub-command
1518+
1519+
| |
1520+
| --------------------------- |
1521+
| setresultmaxwidth \<MAX_COLUMN_WIDTH\> |
1522+
1523+
- Argument
1524+
1525+
| Argument | Note |
1526+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------- |
1527+
| MAX_COLUMN_WIDTH | The length of displayed text, including `...` when the text is longer than the setting width. Must be integer (value ≥ 1). Default is 31. |
1528+
1529+
- Example
1530+
1531+
```example
1532+
gs[public]> sql SELECT * FROM product;
1533+
3 results. (44 ms)
1534+
1535+
gs[public]> get
1536+
+--------------------------+-----------------+---------+---------------------------------------------------------+
1537+
| time | name | weight | note |
1538+
+--------------------------+-----------------+---------+---------------------------------------------------------+
1539+
| 2023-07-04T07:46:27.415Z | apple | 9.99 | Envy |
1540+
| 2023-07-04T07:47:02.731Z | chia | 0.1 | Chia seed from Australia |
1541+
| 2023-07-04T07:50:33.437Z | water and light | 0.0 | Hats off to Geoff Adams, who made this mini-documentary |
1542+
+--------------------------+-----------------+---------+---------------------------------------------------------+
1543+
The 3 results had been acquired.
1544+
1545+
gs[public]> setresultmaxwidth 24
1546+
gs[public]> sql SELECT * from product;
1547+
3 results. (44 ms)
1548+
1549+
gs[public]> get
1550+
+--------------------------+-----------------+---------+--------------------------+
1551+
| time | name | weight | note |
1552+
+--------------------------+-----------------+---------+--------------------------+
1553+
| 2023-07-04T07:46:27.415Z | apple | 9.99 | Envy |
1554+
| 2023-07-04T07:47:02.731Z | chia | 0.1 | Chia seed from Australia |
1555+
| 2023-07-04T07:50:33.437Z | water and light | 0.0 | Hats off to Geoff Ada... |
1556+
+--------------------------+-----------------+---------+--------------------------+
1557+
The 3 results had been acquired.
1558+
```
14761559

14771560

14781561
## Database management

Specification_ja.md

Lines changed: 189 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# クラスタ運用管理コマンド・インタプリタ(gs_sh)
23

34
## 概要
@@ -25,12 +26,41 @@ gs_shを利用するには、あらかじめ以下を実施ください。
2526
- ユーザ作成
2627
- ネットワーク設定(GridDBクラスタ定義ファイル、ノード定義ファイル)
2728

28-
 ※ 手順の詳細に関しては、[GridDB クイックスタートガイド](https://github.com/griddb/docs-ja/blob/master/manuals/GridDB_QuickStartGuide/toc.md)を参照してください
29+
 ※ 手順の詳細に関しては、[GridDB クイックスタートガイド](https://github.com/griddb/docs-ja/blob/master/manuals/GridDB_QuickStartGuide/toc.md)の「GridDBのインストール」の章を参照してください
2930

3031
- SSHによるリモート接続設定
31-
- gs_sh実行環境から各GridDBノード実行環境へ、OSユーザ「gsadm」でSSH接続するための設定
32+
- gs_sh実行環境から各GridDBノード実行環境へ、OSユーザ「gsadm」でSSH接続するために必要な設定<br>
3233
※ SSH接続の手順の詳細に関しては、各OSのマニュアルを参照してください。
3334

35+
[メモ]
36+
37+
以下のOSでは、鍵交換アルゴリズムの追加が必要です。
38+
39+
RHEL9系の場合:
40+
``` example
41+
$ sudo update-crypto-policies --set DEFAULT:SHA1
42+
$ sudo reboot   # OSの再起動
43+
```
44+
45+
Ubuntu 20.04の場合:
46+
``` example
47+
$ vi /etc/ssh/sshd_config # エディタで設定ファイルを編集
48+
...
49+
Kexalgorithms +diffie-hellman-group14-sha1
50+
51+
$ sudo systemctl reload sshd
52+
```
53+
54+
Ubuntu 22.04の場合:
55+
``` example
56+
$ vi /etc/ssh/sshd_config # エディタで設定ファイルを編集
57+
...
58+
Kexalgorithms +diffie-hellman-group14-sha1
59+
HostKeyAlgorithms +ssh-rsa
60+
61+
$ sudo systemctl reload sshd
62+
```
63+
3464
### gs_sh起動
3565
3666
gs_shには2種類の起動モードがあります。
@@ -99,10 +129,10 @@ GridDBノードのIPアドレスとポート番号を、ノード変数に定義
99129
100130
``` example
101131
//4つのGridDBノードを定義
102-
gs> setnode node0 192.168.0.1 10000
103-
gs> setnode node1 192.168.0.2 10000
104-
gs> setnode node2 192.168.0.3 10000
105-
gs> setnode node3 192.168.0.4 10000
132+
gs> setnode node0 192.168.0.1 10040
133+
gs> setnode node1 192.168.0.2 10040
134+
gs> setnode node2 192.168.0.3 10040
135+
gs> setnode node3 192.168.0.4 10040
106136
```
107137

108138
【メモ】
@@ -286,7 +316,7 @@ GridDBクラスタにアクセスするユーザおよびパスワードを定
286316

287317
``` example
288318
//変数を定義
289-
gs> set GS_PORT 10000
319+
gs> set GS_PORT 10040
290320
//変数の設定をクリア
291321
gs> set GS_PORT
292322
```
@@ -320,10 +350,10 @@ GridDBクラスタにアクセスするユーザおよびパスワードを定
320350
//定義した全変数を定表示
321351
gs> show
322352
ノード変数:
323-
node0=Node[192.168.0.1:10000,ssh=22]
324-
node1=Node[192.168.0.2:10000,ssh=22]
325-
node2=Node[192.168.0.3:10000,ssh=22]
326-
node3=Node[192.168.0.4:10000,ssh=22]
353+
node0=Node[192.168.0.1:10040,ssh=22]
354+
node1=Node[192.168.0.2:10040,ssh=22]
355+
node2=Node[192.168.0.3:10040,ssh=22]
356+
node3=Node[192.168.0.4:10040,ssh=22]
327357
クラスタ変数:
328358
cluster0=Cluster[name=name,200.0.0.1:1000,nodes=(node0,node1,node2)]
329359
その他の変数:
@@ -742,6 +772,7 @@ leaveclusterサブコマンドや障害などによってGridDBクラスタか
742772
【メモ】
743773
- 管理ユーザのみが実行可能なコマンドです。
744774
- ノード変数を利用する際には、変数名の先頭に"$"をつけます。
775+
 
745776

746777

747778
<a id="displaying_cluster_status_data"></a>
@@ -1230,6 +1261,7 @@ SQL文の先頭が下記文字列のいずれかである場合、サブコマ
12301261
| DDL文 | 何も表示されません。 |
12311262

12321263
- SQLの詳細に関しては、[GridDB SQLリファレンス](https://github.com/griddb/docs-ja/blob/master/manuals/GridDB_SQL_Reference/toc.md)を参照してください。
1264+
12331265

12341266

12351267
### 検索結果の取得
@@ -1251,6 +1283,147 @@ SQL文の先頭が下記文字列のいずれかである場合、サブコマ
12511283
|----------|----------------------------------------------------------------------------------|
12521284
| 取得件数 | 検索結果の取得件数を指定します。省略すると、全ての検索結果を取得して表示します。 |
12531285

1286+
標準出力の表示形式にはTABLE形式とCSV形式の2種類があります。
1287+
V5.5から表示形式のデフォルトがTABLE形式になります。以前の形式に戻す場合は「表示形式がCSVの場合」を実施してください。
1288+
1289+
(A-1) 標準出力の表示形式を設定します。
1290+
1291+
- サブコマンド
1292+
1293+
| |
1294+
|-|
1295+
| setresultformat \[TABLE\|CSV\] |
1296+
1297+
- 引数
1298+
1299+
| 引数 | 説明 |
1300+
|----------|----------------------------------------------------------------------------------|
1301+
| TABLE\|CSV | 標準出力の表示形式をTABLEまたはCSVで設定します。デフォルトはTABLE形式で標準出力します。 |
1302+
1303+
例)
1304+
1305+
- 表示形式がTABLEの場合
1306+
1307+
``` example
1308+
//表示形式をTABLEに設定
1309+
gs[public]> setresultformat TABLE
1310+
1311+
//検索を実行
1312+
gs[public]> select * from tim1;
1313+
検索を実行しました。 (1 ms)
1314+
1315+
//結果を表示
1316+
gs[public]> get
1317+
+--------------------------+-----------------------------+--------------------------------+
1318+
| date | micro | nano |
1319+
+--------------------------+-----------------------------+--------------------------------+
1320+
| 2022-12-31T00:00:00.123Z | 2022-12-31T00:00:00.123456Z | 2022-12-31T00:00:00.123456789Z |
1321+
+--------------------------+-----------------------------+--------------------------------+
1322+
1 件の取得が完了しました。
1323+
```
1324+
1325+
- 表示形式がCSVの場合
1326+
1327+
``` example
1328+
//表示形式をCSVに設定
1329+
gs[public]> setresultformat CSV
1330+
1331+
//検索を実行
1332+
gs[public]> select * from tim1;
1333+
検索を実行しました。 (2 ms)
1334+
1335+
//結果を表示
1336+
gs[public]> get
1337+
date,micro,nano
1338+
2022-12-31T00:00:00.123Z,2022-12-31T00:00:00.123456Z,2022-12-31T00:00:00.123456789Z
1339+
1 件の取得が完了しました。
1340+
```
1341+
1342+
【メモ】
1343+
- 一度設定するとgs_shの起動中はgetサブコマンドで、設定した表示形式が有効になります。
1344+
- 何度でも表示形式の切り替えは可能です。
1345+
1346+
(A-2) 標準出力の文字列長を設定します。
1347+
1348+
- サブコマンド
1349+
1350+
| |
1351+
|-|
1352+
| setresultmaxwidth \[文字列長\] |
1353+
1354+
- 引数
1355+
1356+
| 引数 | 説明 |
1357+
|----------|----------------------------------------------------------------------------------|
1358+
| 文字列長 | 標準出力の文字列長を自然数で設定します。値はバイト数で設定され、半角英数字の場合は1バイト、日本語の場合は2バイトで設定されます。表示形式がTABLEの場合のみ適用されます。 |
1359+
1360+
例)
1361+
1362+
``` example
1363+
//検索を実行
1364+
gs[public]> select * from tim1;
1365+
検索を実行しました。 (28 ms)
1366+
gs[public]> get
1367+
+--------------------------+-----------------------------+--------------------------------+
1368+
| date | micro | nano |
1369+
+--------------------------+-----------------------------+--------------------------------+
1370+
| 2022-12-31T00:00:00.123Z | 2022-12-31T00:00:00.123456Z | 2022-12-31T00:00:00.123456789Z |
1371+
+--------------------------+-----------------------------+--------------------------------+
1372+
1 件の取得が完了しました。
1373+
1374+
//文字列長を設定
1375+
gs[public]> setresultmaxwidth 29
1376+
1377+
//検索を実行
1378+
gs[public]> select * from tim1;
1379+
検索を実行しました。 (2 ms)
1380+
1381+
//結果を表示
1382+
gs[public]> get
1383+
+--------------------------+-----------------------------+-------------------------------+
1384+
| date | micro | nano |
1385+
+--------------------------+-----------------------------+-------------------------------+
1386+
| 2022-12-31T00:00:00.123Z | 2022-12-31T00:00:00.123456Z | 2022-12-31T00:00:00.123456... |
1387+
+--------------------------+-----------------------------+-------------------------------+
1388+
1 件の取得が完了しました。
1389+
1390+
//文字列長を設定
1391+
gs[public]> setresultmaxwidth 26
1392+
1393+
//検索を実行
1394+
gs[public]> select * from tim1;
1395+
検索を実行しました。 (2 ms)
1396+
1397+
//結果を表示
1398+
gs[public]> get
1399+
+--------------------------+----------------------------+----------------------------+
1400+
| date | micro | nano |
1401+
+--------------------------+----------------------------+----------------------------+
1402+
| 2022-12-31T00:00:00.123Z | 2022-12-31T00:00:00.123... | 2022-12-31T00:00:00.123... |
1403+
+--------------------------+----------------------------+----------------------------+
1404+
1 件の取得が完了しました。
1405+
1406+
//文字列長を設定
1407+
gs[public]> setresultmaxwidth 22
1408+
1409+
//検索を実行
1410+
gs[public]> select * from tim1;
1411+
検索を実行しました。 (1 ms)
1412+
1413+
//結果を表示
1414+
gs[public]> get
1415+
+------------------------+------------------------+------------------------+
1416+
| date | micro | nano |
1417+
+------------------------+------------------------+------------------------+
1418+
| 2022-12-31T00:00:00... | 2022-12-31T00:00:00... | 2022-12-31T00:00:00... |
1419+
+------------------------+------------------------+------------------------+
1420+
1 件の取得が完了しました。
1421+
```
1422+
1423+
【メモ】
1424+
- 一度設定するとgs_shの起動中はgetサブコマンドのTABLE形式の表示で、設定した文字列長が有効になります。
1425+
- 何度でも文字列長の設定は可能です。
1426+
- 取得した結果の値が設定した文字列長より長い場合、設定した文字列長で区切って末尾に「...」が付与されます。
12541427

12551428
(B) 取得した結果をCSV形式でファイルに保存します。
12561429

@@ -2816,6 +2989,9 @@ gs_shのバージョンを表示します。
28162989
【メモ】
28172990
- connectサブコマンド実行後に、settimezoneサブコマンドでタイムゾーン設定を変更した場合、変更後のタイムゾーン設定は再度、connectサブコマンドを実行するまで反映されません。タイムゾーン設定変更を行った後には再度、connectサブコマンドを実行してください。
28182991

2992+
2993+
2994+
28192995
### マルチキャストパケットを受信するインターフェースの設定
28202996

28212997
複数のネットワークインターフェースがあるときにクラスタのネットワーク構成をマルチキャスト方式にする場合、マルチキャストパケットを受信するインターフェースのIPアドレスを指定します。
@@ -2982,6 +3158,8 @@ historyサブコマンドで表示した履歴よりサブコマンドを再実
29823158
| connect | クラスタ変数 \[データベース名\] | GridDBクラスタに接続します。 | |
29833159
| tql | コンテナ名 クエリ ; | 検索を実行し、検索結果を保持します。 | |
29843160
| get | \[ 取得件数 \] | 検索結果を取得し、標準出力に表示します。 | |
3161+
| setresultformat | \[ TABLE\|CSV \] | 標準出力の表示形式を設定します。 | |
3162+
| setresultmaxwidth | \[文字列長\] | 標準出力の文字列長を設定します。 | |
29853163
| getcsv | CSVファイル名 \[ 取得件数 \] | 検索結果を取得し、CSV形式でファイルに保存します。 | |
29863164
| getnoprint | \[ 取得件数 \] | クエリの結果を取得しますが、標準出力に表示しません。 | |
29873165
| tqlclose | | TQLをクローズし、保持する検索結果を破棄します。 | |

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ sourceSets {
1515
}
1616
}
1717

18-
def gridstoreVersion = '5.3.0'
19-
def gridstoreJdbcVersion = '5.3.0'
18+
def gridstoreVersion = '5.5.0'
19+
def gridstoreJdbcVersion = '5.5.0'
2020

2121
repositories {
2222
mavenCentral()

common/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ sourceSets {
1212
}
1313
}
1414

15-
def gridstoreVersion = '5.3.0'
16-
def gridstoreJdbcVersion = '5.3.0'
15+
def gridstoreVersion = '5.5.0'
16+
def gridstoreJdbcVersion = '5.5.0'
1717

1818
dependencies {
1919
implementation 'commons-io:commons-io:2.4'

0 commit comments

Comments
 (0)