This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch rc/1.2.2 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 12dff2e2669341e7c4e5b44d45ee6133142df50f Author: HTHou <[email protected]> AuthorDate: Tue Sep 26 19:09:53 2023 +0800 Revert "[To rel/1.2][IOTDB-6149] Fix incorrect output of UDF with multiple inputs" This reverts commit 3d3eb5943276bf043939965644acd84f8a43fa29. --- .../apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java | 17 +++++++++++------ .../intermediate/MultiInputColumnIntermediateLayer.java | 10 ++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java index 36de61e4411..a878427189b 100644 --- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java @@ -27,6 +27,7 @@ import org.apache.iotdb.itbase.constant.UDFTestConstant; import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -164,12 +165,16 @@ public class IoTDBUDFWindowQueryIT { testSlidingSizeWindow(3 * ITERATION_TIMES); } + // todo: remove ignore when exception handler in IT finishes @Test + @Ignore public void testSlidingSizeWindow7() { testSlidingSizeWindow(0); } + // todo: remove ignore when fixed @Test + @Ignore public void testSlidingSizeWindow8() { testSlidingSizeWindow(-ITERATION_TIMES); } @@ -303,29 +308,34 @@ public class IoTDBUDFWindowQueryIT { } @Test + @Ignore public void testSlidingTimeWindow9() { testSlidingTimeWindow( (int) (0.01 * ITERATION_TIMES), (int) (0.05 * ITERATION_TIMES), ITERATION_TIMES / 2, 0); } @Test + @Ignore public void testSlidingTimeWindow10() { testSlidingTimeWindow( (int) (-0.01 * ITERATION_TIMES), (int) (0.05 * ITERATION_TIMES), 0, ITERATION_TIMES / 2); } @Test + @Ignore public void testSlidingTimeWindow11() { testSlidingTimeWindow( (int) (0.01 * ITERATION_TIMES), (int) (-0.05 * ITERATION_TIMES), 0, ITERATION_TIMES / 2); } @Test + @Ignore public void testSlidingTimeWindow12() { testSlidingTimeWindow((int) (0.01 * ITERATION_TIMES), 0, 0, ITERATION_TIMES / 2); } @Test + @Ignore public void testSlidingTimeWindow13() { testSlidingTimeWindow(0, (int) (0.05 * ITERATION_TIMES), 0, ITERATION_TIMES / 2); } @@ -346,10 +356,6 @@ public class IoTDBUDFWindowQueryIT { UDFTestConstant.DISPLAY_WINDOW_END_KEY, displayWindowEnd); - int expectedCnt = - slidingStep <= 0 - ? 0 - : (int) Math.ceil((displayWindowEnd - displayWindowBegin) / (double) slidingStep); try (Connection conn = EnvFactory.getEnv().getConnection(); Statement statement = conn.createStatement(); ResultSet resultSet = statement.executeQuery(sql)) { @@ -371,7 +377,6 @@ public class IoTDBUDFWindowQueryIT { assertEquals(expectedAccumulation, (int) (Double.parseDouble(resultSet.getString(2)))); ++count; } - assertEquals(expectedCnt, count); } catch (SQLException throwable) { if (slidingStep > 0 && timeInterval > 0 && displayWindowEnd >= displayWindowBegin) { fail(throwable.getMessage()); @@ -408,7 +413,6 @@ public class IoTDBUDFWindowQueryIT { ++count; } - assertEquals(expectedCnt, count); } catch (SQLException throwable) { if (slidingStep > 0 && timeInterval > 0 && displayWindowEnd >= displayWindowBegin) { fail(throwable.getMessage()); @@ -469,6 +473,7 @@ public class IoTDBUDFWindowQueryIT { } @Test + @Ignore public void testSlidingTimeWindowWithTimeIntervalOnly6() { testSlidingTimeWindowWithTimeIntervalOnly(-ITERATION_TIMES); } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java index 8821e90ded0..9ecc8bc08f6 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java @@ -519,17 +519,15 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer @Override public YieldableState yield() throws Exception { if (isFirstIteration) { - if (rowRecordList.size() == 0) { + if (rowRecordList.size() == 0 && nextWindowTimeBegin == Long.MIN_VALUE) { final YieldableState yieldableState = LayerCacheUtils.yieldRow(udfInputDataSet, rowRecordList); if (yieldableState != YieldableState.YIELDABLE) { return yieldableState; } - if (nextWindowTimeBegin == Long.MIN_VALUE) { - // display window begin should be set to the same as the min timestamp of the query - // result set - nextWindowTimeBegin = rowRecordList.getTime(0); - } + // display window begin should be set to the same as the min timestamp of the query + // result set + nextWindowTimeBegin = rowRecordList.getTime(0); } hasAtLeastOneRow = rowRecordList.size() != 0; isFirstIteration = false;
