Skip to content

Commit be5ee75

Browse files
committed
Refactor arithmetic operation tests to use integer types instead of doubles
1 parent 328b3d7 commit be5ee75

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/maxby/IoTDBMaxByIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public void testMaxByWithExpression() {
301301
"max_by(root.db.d1.x5, -cos(sin(root.db.d1.y2 / 10)))",
302302
"max_by(REPLACE(root.db.d1.x6, '3', '4'), -cos(sin(root.db.d1.y2 / 10)))",
303303
};
304-
String[] retArray = new String[] {"0,1.3333333333333333,2.0,2.0,false,2,"};
304+
String[] retArray = new String[] {"0,1,2.0,2.0,false,2,"};
305305
String y = "-cos(sin(y2 / 10))";
306306
resultSetEqualTest(
307307
String.format(
@@ -330,10 +330,7 @@ public void testMaxByWithAlignByDevice() {
330330
"max_by(REPLACE(x6, '3', '4'), -cos(sin(y2 / 10)))",
331331
};
332332
String[] retArray =
333-
new String[] {
334-
"root.db.d1,0,1.3333333333333333,2.0,2.0,false,2,",
335-
"root.db.d2,0,1.3333333333333333,2.0,2.0,false,2,"
336-
};
333+
new String[] {"root.db.d1,0,1,2.0,2.0,false,2,", "root.db.d2,0,1,2.0,2.0,false,2,"};
337334
String y = "-cos(sin(y2 / 10))";
338335
resultSetEqualTest(
339336
String.format(

integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/minby/IoTDBMinByIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public void testMaxByWithExpression() {
300300
"min_by(root.db.d1.x5, -cos(sin(root.db.d1.y2 / 10)))",
301301
"min_by(REPLACE(root.db.d1.x6, '3', '4'), -cos(sin(root.db.d1.y2 / 10)))",
302302
};
303-
String[] retArray = new String[] {"0,1.3333333333333333,2.0,2.0,false,2,"};
303+
String[] retArray = new String[] {"0,1,2.0,2.0,false,2,"};
304304
String y = "-cos(sin(y2 / 10))";
305305
resultSetEqualTest(
306306
String.format(
@@ -329,10 +329,7 @@ public void testMaxByWithAlignByDevice() {
329329
"min_by(REPLACE(x6, '3', '4'), -cos(sin(y2 / 10)))",
330330
};
331331
String[] retArray =
332-
new String[] {
333-
"root.db.d1,0,1.3333333333333333,2.0,2.0,false,2,",
334-
"root.db.d2,0,1.3333333333333333,2.0,2.0,false,2,"
335-
};
332+
new String[] {"root.db.d1,0,1,2.0,2.0,false,2,", "root.db.d2,0,1,2.0,2.0,false,2,"};
336333
String y = "-cos(sin(y2 / 10))";
337334
resultSetEqualTest(
338335
String.format(

integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,28 @@
1919

2020
package org.apache.iotdb.db.it.udf;
2121

22+
import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
23+
import static org.junit.Assert.assertEquals;
24+
import static org.junit.Assert.assertTrue;
25+
import static org.junit.Assert.fail;
26+
27+
import java.sql.Connection;
28+
import java.sql.ResultSet;
29+
import java.sql.SQLException;
30+
import java.sql.Statement;
2231
import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
2332
import org.apache.iotdb.it.env.EnvFactory;
2433
import org.apache.iotdb.it.framework.IoTDBTestRunner;
2534
import org.apache.iotdb.itbase.category.ClusterIT;
2635
import org.apache.iotdb.itbase.category.LocalStandaloneIT;
2736
import org.apache.iotdb.itbase.constant.UDFTestConstant;
28-
2937
import org.junit.AfterClass;
3038
import org.junit.BeforeClass;
3139
import org.junit.Ignore;
3240
import org.junit.Test;
3341
import org.junit.experimental.categories.Category;
3442
import org.junit.runner.RunWith;
3543

36-
import java.sql.Connection;
37-
import java.sql.ResultSet;
38-
import java.sql.SQLException;
39-
import java.sql.Statement;
40-
41-
import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
42-
import static org.junit.Assert.assertEquals;
43-
import static org.junit.Assert.assertTrue;
44-
import static org.junit.Assert.fail;
45-
4644
@RunWith(IoTDBTestRunner.class)
4745
@Category({LocalStandaloneIT.class, ClusterIT.class})
4846
public class IoTDBUDTFHybridQueryIT {
@@ -164,9 +162,9 @@ public void testUserDefinedFunctionFillFunctionHybridQuery() {
164162
"2,0.9092974268256817,3,2.0",
165163
"3,0.1411200080598672,4,3.0",
166164
"4,-0.7568024953079282,5,3.14",
167-
"7,3.14,3.14,7.0",
168-
"8,3.14,3.14,8.0",
169-
"9,3.14,3.14,9.0"
165+
"7,3.14,null,7.0",
166+
"8,3.14,null,8.0",
167+
"9,3.14,null,9.0"
170168
};
171169

172170
try (Connection connection = EnvFactory.getEnv().getConnection();

0 commit comments

Comments
 (0)