This is an automated email from the ASF dual-hosted git repository.
critas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 3805b47e58b remove export tsfile script (#15206)
3805b47e58b is described below
commit 3805b47e58bfbc4d9034fa8d6cc965afa886350b
Author: Summer <[email protected]>
AuthorDate: Thu Mar 27 15:21:15 2025 +0800
remove export tsfile script (#15206)
Co-authored-by: 2b3c511 <[email protected]>
---
.../apache/iotdb/tools/it/ExportTsFileTestIT.java | 4 +-
.../src/assembly/resources/tools/export-tsfile.bat | 62 ----------------------
.../src/assembly/resources/tools/export-tsfile.sh | 59 --------------------
.../apache/iotdb/tool/data/ImportDataTable.java | 7 +--
4 files changed, 6 insertions(+), 126 deletions(-)
diff --git
a/integration-test/src/test/java/org/apache/iotdb/tools/it/ExportTsFileTestIT.java
b/integration-test/src/test/java/org/apache/iotdb/tools/it/ExportTsFileTestIT.java
index b85ef9d6adf..a5db2cb9e1c 100644
---
a/integration-test/src/test/java/org/apache/iotdb/tools/it/ExportTsFileTestIT.java
+++
b/integration-test/src/test/java/org/apache/iotdb/tools/it/ExportTsFileTestIT.java
@@ -68,9 +68,9 @@ public class ExportTsFileTestIT extends AbstractScriptIT {
public void test() throws IOException {
String os = System.getProperty("os.name").toLowerCase();
if (os.startsWith("windows")) {
- testOnWindows();
+ // testOnWindows();
} else {
- testOnUnix();
+ // testOnUnix();
}
}
diff --git a/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.bat
b/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.bat
deleted file mode 100644
index 2c85f42bd62..00000000000
--- a/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM
-
-@echo off
-
-title IoTDB Export
-
-echo ````````````````````````````````````````````````
-echo Starting IoTDB Client Export Script
-echo ````````````````````````````````````````````````
-
-if "%OS%" == "Windows_NT" setlocal
-
-pushd %~dp0..
-if NOT DEFINED IOTDB_HOME set IOTDB_HOME=%CD%
-popd
-
-if NOT DEFINED MAIN_CLASS set
MAIN_CLASS=org.apache.iotdb.tool.tsfile.ExportTsFile
-if NOT DEFINED JAVA_HOME goto :err
-
-@REM
-----------------------------------------------------------------------------
-@REM JVM Opts we'll use in legacy run or installation
-set JAVA_OPTS=-ea^
- -DIOTDB_HOME="%IOTDB_HOME%"
-
-@REM ***** CLASSPATH library setting *****
-set CLASSPATH=%CLASSPATH%;"%IOTDB_HOME%\lib\*"
-
-REM
-----------------------------------------------------------------------------
-
-"%JAVA_HOME%\bin\java" -DIOTDB_HOME="%IOTDB_HOME%" %JAVA_OPTS% -cp %CLASSPATH%
%MAIN_CLASS% %*
-set ret_code=%ERRORLEVEL%
-goto finally
-
-
-:err
-echo JAVA_HOME environment variable must be set!
-set ret_code=1
-pause
-
-@REM
-----------------------------------------------------------------------------
-:finally
-
-ENDLOCAL
-
-EXIT /B %ret_code%
diff --git a/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.sh
b/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.sh
deleted file mode 100644
index ccc9df3e3a4..00000000000
--- a/iotdb-client/cli/src/assembly/resources/tools/export-tsfile.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-echo ------------------------------------------
-echo Starting IoTDB Client Export Script
-echo ------------------------------------------
-
-if [ -z "${IOTDB_INCLUDE}" ]; then
- #do nothing
- :
-elif [ -r "$IOTDB_INCLUDE" ]; then
- . "$IOTDB_INCLUDE"
-fi
-
-if [ -z "${IOTDB_HOME}" ]; then
- export IOTDB_HOME="$(cd "`dirname "$0"`"/..; pwd)"
-fi
-
-if [ -n "$JAVA_HOME" ]; then
- for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
- if [ -x "$java" ]; then
- JAVA="$java"
- break
- fi
- done
-else
- JAVA=java
-fi
-
-if [ -z $JAVA ] ; then
- echo Unable to find java executable. Check JAVA_HOME and PATH environment
variables. > /dev/stderr
- exit 1;
-fi
-
-for f in ${IOTDB_HOME}/lib/*.jar; do
- CLASSPATH=${CLASSPATH}":"$f
-done
-
-MAIN_CLASS=org.apache.iotdb.tool.tsfile.ExportTsFile
-
-"$JAVA" -DIOTDB_HOME=${IOTDB_HOME} -cp "$CLASSPATH" "$MAIN_CLASS" "$@"
-exit $?
\ No newline at end of file
diff --git
a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ImportDataTable.java
b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ImportDataTable.java
index b07565d8d4f..84a307f113f 100644
---
a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ImportDataTable.java
+++
b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ImportDataTable.java
@@ -169,6 +169,7 @@ public class ImportDataTable extends AbstractImportData {
sql = sql.replace(";", "");
session.executeNonQueryStatement(sql);
} catch (IoTDBConnectionException | StatementExecutionException e) {
+ ioTPrinter.println(e.getMessage());
failedRecords.add(Collections.singletonList(sql));
}
}
@@ -256,7 +257,7 @@ public class ImportDataTable extends AbstractImportData {
List<String> headNames = new LinkedList<>(dataTypes.keySet());
List<TSDataType> columnTypes = new LinkedList<>(dataTypes.values());
List<Tablet.ColumnCategory> columnCategorys = new
LinkedList<>(columnCategory.values());
- Tablet tablet = new Tablet(table, headNames, columnTypes, columnCategorys);
+ Tablet tablet = new Tablet(table, headNames, columnTypes, columnCategorys,
batchPointSize);
for (CSVRecord recordObj : records) {
boolean isFail = false;
final int rowSize = tablet.getRowSize();
@@ -283,7 +284,7 @@ public class ImportDataTable extends AbstractImportData {
columnCategorys.add(newIndex, Tablet.ColumnCategory.FIELD);
}
writeAndEmptyDataSet(tablet, 3);
- tablet = new Tablet(table, headNames, columnTypes,
columnCategorys);
+ tablet = new Tablet(table, headNames, columnTypes,
columnCategorys, batchPointSize);
tablet.addTimestamp(rowSize, rowTimeStamp);
} else {
ioTPrinter.printf(
@@ -314,7 +315,7 @@ public class ImportDataTable extends AbstractImportData {
failedRecords.add(recordObj.stream().collect(Collectors.toList()));
}
}
- if (tablet.getValues().length > 0) {
+ if (tablet.getRowSize() > 0) {
writeAndEmptyDataSet(tablet, 3);
}