ericpai commented on a change in pull request #4517:
URL: https://github.com/apache/iotdb/pull/4517#discussion_r766452259
##########
File path:
server/src/main/java/org/apache/iotdb/db/query/expression/unary/FunctionExpression.java
##########
@@ -210,20 +223,30 @@ public IntermediateLayer constructIntermediateLayer(
throws QueryProcessException, IOException {
if (!expressionIntermediateLayerMap.containsKey(this)) {
float memoryBudgetInMB = memoryAssigner.assign();
-
- IntermediateLayer udfInputIntermediateLayer =
- constructUdfInputIntermediateLayer(
- queryId,
- udtfPlan,
- rawTimeSeriesInputLayer,
- expressionIntermediateLayerMap,
- expressionDataTypeMap,
- memoryAssigner);
- Transformer transformer =
- constructUdfTransformer(
- queryId, udtfPlan, expressionDataTypeMap, memoryAssigner,
udfInputIntermediateLayer);
+ Transformer transformer;
+ if (isAggregationFunctionExpression) {
+ transformer =
Review comment:
As this is a special FunctionExpression, aka the aggregation call, like
`avg(a)`. The input is the aggregation result, not the raw timeseries data. In
order to adjust the transformer interface, I use a `TransparentTransformer`
acting as a real one, which only passes data from input reader and output
without any other logics. We can consider `avg(a)` as a function call of
`transparent(t), t=avg(a)` and treat `avg(a)` as a whole input.
So I think there's no need to warry about the `IntermediateLayer`, and I add
a separate test case
`IoTDBUDFNestAggregationIT.complexExpressionsWithTimeFilterTest2` to prove your
SQL.
--
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]