Skip to content

Commit 59a6ef4

Browse files
committed
Implement ArithmeticTransformerApi for arithmetic operations and refactor related transformers
1 parent be5ee75 commit 59a6ef4

File tree

9 files changed

+643
-33
lines changed

9 files changed

+643
-33
lines changed

integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBAliasIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,12 @@ public void UDFQueryAsTest() {
364364
Arrays.asList(
365365
new String[] {},
366366
new String[] {
367-
"0,1,0.013387802193205699,0.5403023058681398,-2.0,",
367+
"0,1,0.013387802193205699,0.5403023058681398,-2,",
368368
"1,2,-0.5449592372801408,-0.4161468365471424,null,",
369369
"2,3,0.8359477452180156,-0.9899924966004454,null,"
370370
},
371371
new String[] {
372-
"0,1,1,0.013387802193205699,0.013387802193205699,0.5403023058681398,-2.0,0.5403023058681398,",
372+
"0,1,1,0.013387802193205699,0.013387802193205699,0.5403023058681398,-2,0.5403023058681398,",
373373
"1,2,2,-0.5449592372801408,-0.5449592372801408,-0.4161468365471424,null,-0.4161468365471424,",
374374
"2,3,3,0.8359477452180156,0.8359477452180156,-0.9899924966004454,null,-0.9899924966004454,"
375375
},

integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,17 +320,17 @@ public void testExpression() {
320320
String expectedQueryHeader = "Time,root.sg_expr.d.k1,root.sg_expr.d.k2,root.sg_expr.d.k3,";
321321
String[] queryRetArray =
322322
new String[] {
323-
"1,2.0,null,null,",
323+
"1,2,null,null,",
324324
"2,null,-0.9092974268256817,null,",
325-
"3,6.0,-0.1411200080598672,null,",
325+
"3,6,-0.1411200080598672,null,",
326326
"4,null,0.7568024953079282,null,",
327327
"6,null,0.27941549819892586,null,",
328-
"7,14.0,-0.6569865987187891,null,",
329-
"8,16.0,-0.9893582466233818,8.0,",
328+
"7,14,-0.6569865987187891,null,",
329+
"8,16,-0.9893582466233818,8.0,",
330330
"9,null,-0.4121184852417566,null,",
331-
"10,20.0,null,10.0,",
331+
"10,20,null,10.0,",
332332
"11,null,0.9999902065507035,11.0,",
333-
"12,24.0,0.5365729180004349,null,"
333+
"12,24,0.5365729180004349,null,"
334334
};
335335
resultSetEqualTest(
336336
"select k1, k2, k3 from root.sg_expr.d;", expectedQueryHeader, queryRetArray);

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,30 @@
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;
3122
import org.apache.iotdb.commons.schema.column.ColumnHeaderConstant;
3223
import org.apache.iotdb.it.env.EnvFactory;
3324
import org.apache.iotdb.it.framework.IoTDBTestRunner;
3425
import org.apache.iotdb.itbase.category.ClusterIT;
3526
import org.apache.iotdb.itbase.category.LocalStandaloneIT;
3627
import org.apache.iotdb.itbase.constant.UDFTestConstant;
28+
3729
import org.junit.AfterClass;
3830
import org.junit.BeforeClass;
3931
import org.junit.Ignore;
4032
import org.junit.Test;
4133
import org.junit.experimental.categories.Category;
4234
import org.junit.runner.RunWith;
4335

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+
4446
@RunWith(IoTDBTestRunner.class)
4547
@Category({LocalStandaloneIT.class, ClusterIT.class})
4648
public class IoTDBUDTFHybridQueryIT {

iotdb-core/datanode/pom.xml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
under the License.
2020
2121
-->
22-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2324
<modelVersion>4.0.0</modelVersion>
2425
<parent>
2526
<groupId>org.apache.iotdb</groupId>
@@ -546,6 +547,34 @@
546547
<target>8</target>
547548
</configuration>
548549
</plugin>
550+
<plugin>
551+
<groupId>com.diffplug.spotless</groupId>
552+
<artifactId>spotless-maven-plugin</artifactId>
553+
<executions>
554+
<execution>
555+
<id>format-generated-sources</id>
556+
<phase>process-sources</phase>
557+
<goals>
558+
<goal>apply</goal>
559+
</goals>
560+
<configuration>
561+
<java>
562+
<googleJavaFormat>
563+
<version>${google.java.format.version}</version>
564+
<style>GOOGLE</style>
565+
</googleJavaFormat>
566+
<importOrder>
567+
<order>org.apache.iotdb,,javax,java,\#</order>
568+
</importOrder>
569+
<removeUnusedImports/>
570+
<includes>
571+
<include>target/generated-sources/**/*.java</include>
572+
</includes>
573+
</java>
574+
</configuration>
575+
</execution>
576+
</executions>
577+
</plugin>
549578
</plugins>
550579
</build>
551580
<profiles>

0 commit comments

Comments
 (0)