Skip to content

Commit db715b7

Browse files
2b3c5112b3c511
andauthored
Combine CSV SQL TSfile data import/export script (apache#13930) (apache#14191)
* [To rc/1.3.3] Combine CSV SQL TSfile data import/export script (apache#13930) Co-authored-by: 2b3c511 <[email protected]> * delete type_info parma in import_data.sh -ft sql (apache#14103) Co-authored-by: 2b3c511 <[email protected]> --------- Co-authored-by: 2b3c511 <[email protected]>
1 parent 7af7c80 commit db715b7

File tree

16 files changed

+2182
-884
lines changed

16 files changed

+2182
-884
lines changed

integration-test/src/test/java/org/apache/iotdb/tools/it/ExportDataTestIT.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ protected void testOnWindows() throws IOException {
8989
"root",
9090
"-pw",
9191
"root",
92+
"-ft",
93+
"csv",
9294
"-t",
9395
"target",
9496
"-q",
@@ -115,6 +117,8 @@ protected void testOnWindows() throws IOException {
115117
"root",
116118
"-pw",
117119
"root",
120+
"-ft",
121+
"csv",
118122
"-t",
119123
"target",
120124
"-q",
@@ -143,7 +147,7 @@ protected void testOnWindows() throws IOException {
143147
"root",
144148
"-t",
145149
"target",
146-
"-type",
150+
"-ft",
147151
"sql",
148152
"-q",
149153
"select * from root.test.t2 where time > 1 and time < 1000000000000",
@@ -170,6 +174,8 @@ protected void testOnUnix() throws IOException {
170174
"root",
171175
"-pw",
172176
"root",
177+
"-ft",
178+
"csv",
173179
"-t",
174180
"target",
175181
"-q",
@@ -195,6 +201,8 @@ protected void testOnUnix() throws IOException {
195201
"root",
196202
"-t",
197203
"target",
204+
"-ft",
205+
"csv",
198206
"-q",
199207
"select * from root.**");
200208
builder1.environment().put("CLASSPATH", libPath);
@@ -218,7 +226,7 @@ protected void testOnUnix() throws IOException {
218226
"root",
219227
"-t",
220228
"target",
221-
"-type",
229+
"-ft",
222230
"sql",
223231
"-q",
224232
"select * from root.test.t2 where time > 1 and time < 1000000000000");

integration-test/src/test/java/org/apache/iotdb/tools/it/ImportDataTestIT.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void test() throws IOException {
7474
@Override
7575
protected void testOnWindows() throws IOException {
7676
final String[] output = {
77-
"The file name must end with \"csv\" or \"txt\"!",
77+
"Source file or directory ./csv/ does not exist",
7878
};
7979
ProcessBuilder builder =
8080
new ProcessBuilder(
@@ -89,19 +89,21 @@ protected void testOnWindows() throws IOException {
8989
"root",
9090
"-pw",
9191
"root",
92+
"-ft",
93+
"csv",
9294
"-s",
93-
"./",
95+
"./csv/",
9496
"&",
9597
"exit",
9698
"%^errorlevel%");
9799
builder.environment().put("CLASSPATH", libPath);
98-
testOutput(builder, output, 0);
100+
testOutput(builder, output, 1);
99101
}
100102

101103
@Override
102104
protected void testOnUnix() throws IOException {
103105
final String[] output = {
104-
"The file name must end with \"csv\" or \"txt\"!",
106+
"Source file or directory ./csv/ does not exist",
105107
};
106108
ProcessBuilder builder =
107109
new ProcessBuilder(
@@ -115,9 +117,11 @@ protected void testOnUnix() throws IOException {
115117
"root",
116118
"-pw",
117119
"root",
120+
"-ft",
121+
"csv",
118122
"-s",
119-
"./");
123+
"./csv/");
120124
builder.environment().put("CLASSPATH", libPath);
121-
testOutput(builder, output, 0);
125+
testOutput(builder, output, 1);
122126
}
123127
}

iotdb-client/cli/src/assembly/resources/tools/export-data.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
title IoTDB Export
2323

24-
echo ````````````````````````````````````````````````
25-
echo Starting IoTDB Client Export Script
26-
echo ````````````````````````````````````````````````
24+
@REM echo ````````````````````````````````````````````````
25+
@REM echo Starting IoTDB Client Export Script
26+
@REM echo ````````````````````````````````````````````````
2727

2828
if "%OS%" == "Windows_NT" setlocal
2929

iotdb-client/cli/src/assembly/resources/tools/export-data.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
# under the License.
1919
#
2020

21-
echo ------------------------------------------
22-
echo Starting IoTDB Client Export Script
23-
echo ------------------------------------------
21+
#echo ------------------------------------------
22+
#echo Starting IoTDB Client Export Script
23+
#echo ------------------------------------------
2424

2525
if [ -z "${IOTDB_INCLUDE}" ]; then
2626
#do nothing

iotdb-client/cli/src/assembly/resources/tools/import-data.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222
title IoTDB Import
2323

24-
echo ````````````````````````````````````````````````
25-
echo Starting IoTDB Client Import Script
26-
echo ````````````````````````````````````````````````
24+
@REM echo ````````````````````````````````````````````````
25+
@REM echo Starting IoTDB Client Import Script
26+
@REM echo ````````````````````````````````````````````````
2727

2828
if "%OS%" == "Windows_NT" setlocal
2929

iotdb-client/cli/src/assembly/resources/tools/import-data.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
# under the License.
1919
#
2020

21-
echo ------------------------------------------
22-
echo Starting IoTDB Client Import Script
23-
echo ------------------------------------------
21+
#echo ------------------------------------------
22+
#echo Starting IoTDB Client Import Script
23+
#echo ------------------------------------------
2424

2525
if [ -z "${IOTDB_INCLUDE}" ]; then
2626
#do nothing

0 commit comments

Comments
 (0)