Skip to content

Commit 62aa4d6

Browse files
committed
Merge branch 'master' into showConfigurationSQL
2 parents ccb68fe + 0a2166f commit 62aa4d6

113 files changed

Lines changed: 3910 additions & 634 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

example/client-cpp-example/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
<sourceFile>${project.basedir}/src/TableModelSessionExample.cpp</sourceFile>
6565
<destinationFile>${project.build.directory}/TableModelSessionExample.cpp</destinationFile>
6666
</fileSet>
67+
<fileSet>
68+
<sourceFile>${project.basedir}/src/MultiSvrNodeClient.cpp</sourceFile>
69+
<destinationFile>${project.build.directory}/MultiSvrNodeClient.cpp</destinationFile>
70+
</fileSet>
6771
<fileSet>
6872
<sourceFile>${project.basedir}/src/CMakeLists.txt</sourceFile>
6973
<destinationFile>${project.build.directory}/CMakeLists.txt</destinationFile>

example/client-cpp-example/src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/client/lib)
3939
ADD_EXECUTABLE(SessionExample SessionExample.cpp)
4040
ADD_EXECUTABLE(AlignedTimeseriesSessionExample AlignedTimeseriesSessionExample.cpp)
4141
ADD_EXECUTABLE(TableModelSessionExample TableModelSessionExample.cpp)
42+
ADD_EXECUTABLE(MultiSvrNodeClient MultiSvrNodeClient.cpp)
4243

4344
IF(MSVC)
4445
TARGET_LINK_LIBRARIES(SessionExample iotdb_session "${CMAKE_SOURCE_DIR}/thrift/lib/Release/thriftmd.lib")
4546
TARGET_LINK_LIBRARIES(AlignedTimeseriesSessionExample iotdb_session "${CMAKE_SOURCE_DIR}/thrift/lib/Release/thriftmd.lib")
4647
TARGET_LINK_LIBRARIES(TableModelSessionExample iotdb_session "${CMAKE_SOURCE_DIR}/thrift/lib/Release/thriftmd.lib")
48+
TARGET_LINK_LIBRARIES(MultiSvrNodeClient iotdb_session "${CMAKE_SOURCE_DIR}/thrift/lib/Release/thriftmd.lib")
4749
ELSE()
4850
TARGET_LINK_LIBRARIES(SessionExample iotdb_session pthread)
4951
TARGET_LINK_LIBRARIES(AlignedTimeseriesSessionExample iotdb_session pthread)
5052
TARGET_LINK_LIBRARIES(TableModelSessionExample iotdb_session pthread)
51-
ENDIF()
53+
TARGET_LINK_LIBRARIES(MultiSvrNodeClient iotdb_session pthread)
54+
ENDIF()

iotdb-client/client-cpp/src/example/MultiSvrNodeClient.cpp renamed to example/client-cpp-example/src/MultiSvrNodeClient.cpp

File renamed without changes.

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppCommonConfig.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@ public CommonConfig setEncryptType(String encryptType) {
103103
return this;
104104
}
105105

106-
@Override
107-
public CommonConfig setEncryptKeyPath(String encryptKeyPath) {
108-
setProperty("encrypt_key_path", encryptKeyPath);
109-
return this;
110-
}
111-
112106
@Override
113107
public CommonConfig setEnableGrantOption(boolean enableGrantOption) {
114108
setProperty("enable_grant_option", String.valueOf(enableGrantOption));

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppSharedCommonConfig.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ public CommonConfig setEncryptType(String encryptType) {
8282
return this;
8383
}
8484

85-
@Override
86-
public CommonConfig setEncryptKeyPath(String encryptKeyPath) {
87-
cnConfig.setProperty("encrypt_key_path", encryptKeyPath);
88-
dnConfig.setProperty("encrypt_key_path", encryptKeyPath);
89-
return this;
90-
}
91-
9285
@Override
9386
public CommonConfig setEnableGrantOption(boolean enableGrantOption) {
9487
cnConfig.setEnableGrantOption(enableGrantOption);

integration-test/src/main/java/org/apache/iotdb/it/env/remote/config/RemoteCommonConfig.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ public CommonConfig setEncryptType(String encryptType) {
5959
return this;
6060
}
6161

62-
@Override
63-
public CommonConfig setEncryptKeyPath(String encryptKeyPath) {
64-
return this;
65-
}
66-
6762
@Override
6863
public CommonConfig setEnableGrantOption(boolean enableGrantOption) {
6964
return this;

integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ public interface CommonConfig {
3838

3939
CommonConfig setEncryptType(String encryptType);
4040

41-
CommonConfig setEncryptKeyPath(String encryptKeyPath);
42-
4341
CommonConfig setEnableGrantOption(boolean enableGrantOption);
4442

4543
CommonConfig setConfigRegionRatisRPCLeaderElectionTimeoutMaxMs(int maxMs);

integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.sql.ResultSetMetaData;
4141
import java.sql.SQLException;
4242
import java.sql.Statement;
43+
import java.sql.Types;
4344
import java.text.DateFormat;
4445
import java.time.ZoneId;
4546
import java.time.ZoneOffset;
@@ -51,6 +52,7 @@
5152
import java.util.List;
5253
import java.util.Map;
5354
import java.util.Objects;
55+
import java.util.Optional;
5456
import java.util.Set;
5557
import java.util.TreeMap;
5658
import java.util.concurrent.TimeUnit;
@@ -233,6 +235,18 @@ public static void tableResultSetEqualTest(
233235
"+00:00");
234236
}
235237

238+
public static void tableResultSetEqualByDataTypeTest(
239+
String sql, String[] expectedHeader, String[] expectedRetArray, String database) {
240+
tableResultSetEqualByDataTypeTest(
241+
sql,
242+
expectedHeader,
243+
expectedRetArray,
244+
SessionConfig.DEFAULT_USER,
245+
SessionConfig.DEFAULT_PASSWORD,
246+
database,
247+
"+00:00");
248+
}
249+
236250
public static void tableResultSetEqualTest(
237251
String sql,
238252
String timeZone,
@@ -298,6 +312,57 @@ public static void tableResultSetEqualTest(
298312
}
299313
}
300314

315+
public static void tableResultSetEqualByDataTypeTest(
316+
String sql,
317+
String[] expectedHeader,
318+
String[] expectedRetArray,
319+
String userName,
320+
String password,
321+
String database,
322+
String timeZone) {
323+
try (Connection connection =
324+
EnvFactory.getEnv().getConnection(userName, password, BaseEnv.TABLE_SQL_DIALECT)) {
325+
connection.setClientInfo("time_zone", timeZone);
326+
try (Statement statement = connection.createStatement()) {
327+
statement.execute("use " + database);
328+
try (ResultSet resultSet = statement.executeQuery(sql)) {
329+
ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
330+
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
331+
assertEquals(expectedHeader[i - 1], resultSetMetaData.getColumnName(i));
332+
}
333+
assertEquals(expectedHeader.length, resultSetMetaData.getColumnCount());
334+
335+
int cnt = 0;
336+
while (resultSet.next()) {
337+
for (int i = 1; i <= expectedHeader.length; i++) {
338+
if (resultSetMetaData.getColumnType(i) == Types.BOOLEAN) {
339+
assertEquals(
340+
Boolean.valueOf(expectedRetArray[cnt].split(",")[i - 1]),
341+
resultSet.getBoolean(i));
342+
} else if (resultSetMetaData.getColumnType(i) == Types.INTEGER) {
343+
assertEquals(
344+
Optional.of(Integer.valueOf(expectedRetArray[cnt].split(",")[i - 1])),
345+
Optional.of(resultSet.getInt(i)));
346+
} else if (resultSetMetaData.getColumnType(i) == Types.DOUBLE) {
347+
assertEquals(
348+
Double.valueOf(expectedRetArray[cnt].split(",")[i - 1]),
349+
resultSet.getDouble(i),
350+
DELTA);
351+
} else if (resultSetMetaData.getColumnType(i) == Types.VARCHAR) {
352+
assertEquals(expectedRetArray[cnt].split(",")[i - 1], resultSet.getString(i));
353+
}
354+
}
355+
cnt++;
356+
}
357+
assertEquals(expectedRetArray.length, cnt);
358+
}
359+
}
360+
} catch (SQLException e) {
361+
e.printStackTrace();
362+
fail(e.getMessage());
363+
}
364+
}
365+
301366
public static void tableExecuteTest(String sql, String userName, String password) {
302367
try (Connection connection =
303368
EnvFactory.getEnv().getConnection(userName, password, BaseEnv.TABLE_SQL_DIALECT)) {

0 commit comments

Comments
 (0)