ericpai commented on a change in pull request #4517:
URL: https://github.com/apache/iotdb/pull/4517#discussion_r766448194



##########
File path: 
server/src/main/java/org/apache/iotdb/db/query/dataset/UDFInputDataSet.java
##########
@@ -16,19 +16,51 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.iotdb.db.query.dataset;
 
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.read.common.Field;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
 
 import java.io.IOException;
 import java.util.List;
 
-public interface UDFInputDataSet {
+/**
+ * the input data set of an UDAF query. It accepts any query results as input 
instead of raw
+ * timeseries data
+ */
+public class UDFInputDataSet implements IUDFInputDataSet {
+
+  private final QueryDataSet dataSet;
+  private List<TSDataType> dataTypes;
+
+  public UDFInputDataSet(QueryDataSet dataSet, List<TSDataType> dataTypes) {
+    this.dataSet = dataSet;
+    this.dataTypes = dataTypes;
+  }
 
-  List<TSDataType> getDataTypes();
+  @Override
+  public List<TSDataType> getDataTypes() {
+    return dataTypes;
+  }
 
-  boolean hasNextRowInObjects() throws IOException;
+  @Override
+  public boolean hasNextRowInObjects() throws IOException {
+    return dataSet.hasNextWithoutConstraint();
+  }
 
-  Object[] nextRowInObjects() throws IOException;
+  @Override
+  public Object[] nextRowInObjects() throws IOException {
+    Object[] nextRow = new Object[dataSet.getColumnNum() + 1];
+    RowRecord r = dataSet.next();

Review comment:
       This bug has been fixed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to