You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/11/26 06:53:48 UTC

[iotdb] branch xianyi updated: modify udtf en type

This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch xianyi
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/xianyi by this push:
     new 81e5a82  modify udtf en type
     new c221c0d  Merge branch 'xianyi' of github.com:apache/iotdb into xianyi
81e5a82 is described below

commit 81e5a823d2d0e37df3d367e473940a1223f1eb51
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Fri Nov 26 14:51:23 2021 +0800

    modify udtf en type
---
 .../src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFEn.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFEn.java b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFEn.java
index cb624a2..2a29785 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFEn.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/udf/builtin/UDTFEn.java
@@ -45,11 +45,11 @@ public class UDTFEn implements UDTF {
       return;
     }
 
-    double quadraticSum = 0;
+    long quadraticSum = 0;
     for (int i = 0; i < windowSize; ++i) {
-      double raw = rowWindow.getRow(i).getDouble(0);
+      long raw = rowWindow.getRow(i).getInt(0);
       quadraticSum += raw * raw;
     }
-    collector.putDouble(rowWindow.getRow(0).getTime(), quadraticSum / windowSize);
+    collector.putDouble(rowWindow.getRow(0).getTime(), (double) quadraticSum / windowSize);
   }
 }