You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ch...@apache.org on 2020/09/21 05:51:14 UTC
[incubator-iotdb] 02/02: debug importcsv
This is an automated email from the ASF dual-hosted git repository.
chaow pushed a commit to branch cross-tests
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
commit d8126a16e4067dcfba67c98f63c5629aeb6c825e
Author: chaow <xu...@gmail.com>
AuthorDate: Mon Sep 21 13:49:59 2020 +0800
debug importcsv
---
.../main/java/org/apache/iotdb/tool/ImportCsv.java | 5 ++++
.../tests/tools/importCsv/AbstractScript.java | 4 +++
hadoop/pom.xml | 2 +-
hive-connector/pom.xml | 28 +++++++++++++++++++
jdbc/pom.xml | 2 +-
server/pom.xml | 2 +-
server/src/test/resources/logback.xml | 2 +-
session/pom.xml | 2 +-
spark-tsfile/pom.xml | 31 ++++++++++++++++++++++
tsfile/pom.xml | 2 +-
10 files changed, 74 insertions(+), 6 deletions(-)
diff --git a/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java b/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
index ee83572..f8e81b0 100644
--- a/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
+++ b/cli/src/main/java/org/apache/iotdb/tool/ImportCsv.java
@@ -50,11 +50,14 @@ import org.apache.iotdb.jdbc.Config;
import org.apache.iotdb.jdbc.IoTDBConnection;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* read a CSV formatted data File and insert all the data into IoTDB.
*/
public class ImportCsv extends AbstractCsvTool {
+ private static Logger logger = LoggerFactory.getLogger(ImportCsv.class);
private static final String FILE_ARGS = "f";
private static final String FILE_NAME = "file or folder";
private static final String FILE_SUFFIX = "csv";
@@ -349,9 +352,11 @@ public class ImportCsv extends AbstractCsvTool {
String[] data = line.split(",", headInfo.size() + 1);
List<String> sqls = new ArrayList<>();
Iterator<Map.Entry<String, ArrayList<Integer>>> it = deviceToColumn.entrySet().iterator();
+ logger.info(line);
while (it.hasNext()) {
Map.Entry<String, ArrayList<Integer>> entry = it.next();
String sql = createOneSql(entry, data, colInfo, timeseriesToType, headInfo);
+ logger.info(sql);
if (sql != null) {
sqls.add(sql);
}
diff --git a/cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/AbstractScript.java b/cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/AbstractScript.java
index 57bff02..25edba3 100644
--- a/cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/AbstractScript.java
+++ b/cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/AbstractScript.java
@@ -44,6 +44,10 @@ public abstract class AbstractScript {
r.close();
p.destroy();
+ for (int i = 0; i < actualOutput.size(); i++) {
+ System.out.println(actualOutput.get(i));
+ }
+
for (int i = 0; i < output.length; i++) {
assertTrue(actualOutput.get(i).startsWith(output[i]));
}
diff --git a/hadoop/pom.xml b/hadoop/pom.xml
index df3087c..da37984 100644
--- a/hadoop/pom.xml
+++ b/hadoop/pom.xml
@@ -32,7 +32,7 @@
<name>IoTDB Hadoop-Tsfile</name>
<url>http://maven.apache.org</url>
<properties>
- <hadoop.test.skip>false</hadoop.test.skip>
+ <hadoop.test.skip>true</hadoop.test.skip>
<hadoop.it.skip>${hadoop.test.skip}</hadoop.it.skip>
<hadoop.ut.skip>${hadoop.test.skip}</hadoop.ut.skip>
</properties>
diff --git a/hive-connector/pom.xml b/hive-connector/pom.xml
index 77f3124..12e5ce3 100644
--- a/hive-connector/pom.xml
+++ b/hive-connector/pom.xml
@@ -33,6 +33,9 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compile.version>1.8</compile.version>
+ <hive.test.skip>true</hive.test.skip>
+ <hive.it.skip>${hive.test.skip}</hive.it.skip>
+ <hive.ut.skip>${hive.test.skip}</hive.ut.skip>
</properties>
<dependencies>
<dependency>
@@ -152,6 +155,31 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>${hive.ut.skip}</skipTests>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <skipTests>${hive.test.skip}</skipTests>
+ <skipITs>${hive.it.skip}</skipITs>
+ </configuration>
+ </plugin>
+ <plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven.assembly.version}</version>
<configuration>
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index 87dc567..0e844f8 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -31,7 +31,7 @@
<name>IoTDB Jdbc</name>
<description>A jdbc driver for a time series database, IoTDB, which uses TsFile as its storage format on disk.</description>
<properties>
- <jdbc.test.skip>false</jdbc.test.skip>
+ <jdbc.test.skip>true</jdbc.test.skip>
<jdbc.it.skip>${jdbc.test.skip}</jdbc.it.skip>
<jdbc.ut.skip>${jdbc.test.skip}</jdbc.ut.skip>
</properties>
diff --git a/server/pom.xml b/server/pom.xml
index cbdb003..2fe0fb5 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -30,7 +30,7 @@
<artifactId>iotdb-server</artifactId>
<name>IoTDB Server</name>
<properties>
- <iotdb.test.skip>false</iotdb.test.skip>
+ <iotdb.test.skip>true</iotdb.test.skip>
<iotdb.it.skip>${iotdb.test.skip}</iotdb.it.skip>
<iotdb.ut.skip>${iotdb.test.skip}</iotdb.ut.skip>
</properties>
diff --git a/server/src/test/resources/logback.xml b/server/src/test/resources/logback.xml
index a1c1c44..aedd328 100644
--- a/server/src/test/resources/logback.xml
+++ b/server/src/test/resources/logback.xml
@@ -49,7 +49,7 @@
<logger name="org.apache.iotdb.db.service.RPCService" level="INFO"/>
<logger name="org.apache.iotdb.db.service.MQTTService" level="INFO"/>
<logger name="org.apache.iotdb.db.sync.receiver.SyncServerManager" level="INFO"/>
- <root level="WARN">
+ <root level="DEBUG">
<appender-ref ref="stdout"/>
</root>
</configuration>
diff --git a/session/pom.xml b/session/pom.xml
index a5f75a3..ebe0574 100644
--- a/session/pom.xml
+++ b/session/pom.xml
@@ -30,7 +30,7 @@
<artifactId>iotdb-session</artifactId>
<name>IoTDB Session</name>
<properties>
- <session.test.skip>false</session.test.skip>
+ <session.test.skip>true</session.test.skip>
<session.it.skip>${session.test.skip}</session.it.skip>
<session.ut.skip>${session.test.skip}</session.ut.skip>
</properties>
diff --git a/spark-tsfile/pom.xml b/spark-tsfile/pom.xml
index 5d846c0..72855c1 100644
--- a/spark-tsfile/pom.xml
+++ b/spark-tsfile/pom.xml
@@ -30,6 +30,12 @@
<artifactId>spark-tsfile</artifactId>
<packaging>jar</packaging>
<name>IoTDB Spark-TsFile</name>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <spark.file.test.skip>true</spark.file.test.skip>
+ <spark.file.it.skip>${spark.file.test.skip}</spark.file.it.skip>
+ <spark.file.ut.skip>${spark.file.test.skip}</spark.file.ut.skip>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.iotdb</groupId>
@@ -74,6 +80,31 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>${spark.file.ut.skip}</skipTests>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>run-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <skipTests>${spark.file.test.skip}</skipTests>
+ <skipITs>${spark.file.it.skip}</skipITs>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.0</version>
diff --git a/tsfile/pom.xml b/tsfile/pom.xml
index 3e235fa..d11f763 100644
--- a/tsfile/pom.xml
+++ b/tsfile/pom.xml
@@ -32,7 +32,7 @@
<description>A columnar file format designed for time-series data</description>
<url>https://github.com/thulab/iotdb/tree/master/tsfile</url>
<properties>
- <tsfile.test.skip>false</tsfile.test.skip>
+ <tsfile.test.skip>true</tsfile.test.skip>
<tsfile.it.skip>${tsfile.test.skip}</tsfile.it.skip>
<tsfile.ut.skip>${tsfile.test.skip}</tsfile.ut.skip>
</properties>