You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2021/03/25 11:26:38 UTC
[iotdb] branch master updated: Add the method size() to Row in UDF
(#2897)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 952a180 Add the method size() to Row in UDF (#2897)
952a180 is described below
commit 952a180c6cebfc88dd72e4462ab37212b8b2b9f9
Author: Haoyu Wang <37...@users.noreply.github.com>
AuthorDate: Thu Mar 25 19:26:18 2021 +0800
Add the method size() to Row in UDF (#2897)
---
.gitignore | 2 +-
.../main/java/org/apache/iotdb/db/query/udf/api/access/Row.java | 7 +++++++
.../java/org/apache/iotdb/db/query/udf/core/access/RowImpl.java | 5 +++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index a136207..f6ad96b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -99,4 +99,4 @@ classes/
### Cmake files ###
*.cmake
Makefile
-**/CMakeFiles/
+**/CMakeFiles/
\ No newline at end of file
diff --git a/server/src/main/java/org/apache/iotdb/db/query/udf/api/access/Row.java b/server/src/main/java/org/apache/iotdb/db/query/udf/api/access/Row.java
index 0eefdc5..5939a5d 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/udf/api/access/Row.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/udf/api/access/Row.java
@@ -118,4 +118,11 @@ public interface Row {
* @return {@code true} if the value of the specified column is null
*/
boolean isNull(int columnIndex);
+
+ /**
+ * Returns the number of columns
+ *
+ * @return the number of columns
+ */
+ int size();
}
diff --git a/server/src/main/java/org/apache/iotdb/db/query/udf/core/access/RowImpl.java b/server/src/main/java/org/apache/iotdb/db/query/udf/core/access/RowImpl.java
index 39f38eb..e186200 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/udf/core/access/RowImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/udf/core/access/RowImpl.java
@@ -89,4 +89,9 @@ public class RowImpl implements Row {
this.rowRecord = rowRecord;
return this;
}
+
+ @Override
+ public int size() {
+ return this.columnIndexes.length;
+ }
}