Skip to content

Commit

Permalink
[IOTDB-6350] Correct the allSatisfy for InFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieTien97 authored Aug 29, 2024
1 parent 2eda8be commit 1aeeffb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ public class IoTDBFilterNullIT {
"CREATE DATABASE root.testNullFilter",
"CREATE TIMESERIES root.testNullFilter.d1.s1 WITH DATATYPE=INT32, ENCODING=PLAIN",
"CREATE TIMESERIES root.testNullFilter.d1.s2 WITH DATATYPE=BOOLEAN, ENCODING=PLAIN",
"CREATE TIMESERIES root.testNullFilter.d1.s3 WITH DATATYPE=DOUBLE, ENCODING=PLAIN"
"CREATE TIMESERIES root.testNullFilter.d1.s3 WITH DATATYPE=DOUBLE, ENCODING=PLAIN",
"CREATE ALIGNED TIMESERIES root.testNullFilter.d2(s1 INT32, s2 BOOLEAN, s3 DOUBLE);"
};

private static final String[] insertSqls =
new String[] {
"INSERT INTO root.testNullFilter.d1(timestamp,s2,s3) " + "values(1, false, 11.1)",
"INSERT INTO root.testNullFilter.d1(timestamp,s1,s2) " + "values(2, 22, true)",
"INSERT INTO root.testNullFilter.d1(timestamp,s1,s3) " + "values(3, 23, 33.3)",
"INSERT INTO root.testNullFilter.d2(timestamp,s2,s3) " + "values(1, false, 11.1)",
"INSERT INTO root.testNullFilter.d2(timestamp,s1,s2) " + "values(2, 22, true)",
"INSERT INTO root.testNullFilter.d2(timestamp,s1,s2) " + "values(3, 22, false)",
};

private static void prepareData() {
Expand Down Expand Up @@ -128,7 +132,34 @@ public void nullFilterTest() {
assertEquals(retArray.length, count);
}
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
}
}

@Test
public void inPushDownTest() {
String[] retArray = new String[] {"2,22,true,null", "3,22,false,null"};
try (Connection connectionIsNull = EnvFactory.getEnv().getConnection();
Statement statementIsNull = connectionIsNull.createStatement()) {
int count = 0;
try (ResultSet resultSet =
statementIsNull.executeQuery(
"select * from root.testNullFilter.d2 where s1 in (22, 23)")) {
while (resultSet.next()) {
String ans =
resultSet.getString(ColumnHeaderConstant.TIME)
+ ","
+ resultSet.getString("root.testNullFilter.d2.s1")
+ ","
+ resultSet.getString("root.testNullFilter.d2.s2")
+ ","
+ resultSet.getString("root.testNullFilter.d2.s3");
assertEquals(retArray[count], ans);
count++;
}
assertEquals(retArray.length, count);
}
} catch (Exception e) {
fail(e.getMessage());
}
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<thrift.version>0.14.1</thrift.version>
<xz.version>1.9</xz.version>
<zstd-jni.version>1.5.6-3</zstd-jni.version>
<tsfile.version>1.1.0-86d5641f-SNAPSHOT</tsfile.version>
<tsfile.version>1.1.0-1fd60299-SNAPSHOT</tsfile.version>
</properties>
<!--
if we claim dependencies in dependencyManagement, then we do not claim
Expand Down

0 comments on commit 1aeeffb

Please sign in to comment.