Copilot commented on code in PR #17411:
URL: https://github.com/apache/iotdb/pull/17411#discussion_r3610109273
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java:
##########
@@ -322,12 +323,14 @@ private void buildResultUseLastRowCache() {
private void buildResultUseLastValuesCache() {
TimeValuePair[] currentHitResult =
lastValuesCacheResults.get(currentHitCacheIndex);
- // if it is EMPTY_PRIMITIVE_TYPE, means there is no data in device
+ // if it is PLACEHOLDER_NO_VALUE, means there is no data in device
TsPrimitiveType timeLastValue = currentHitResult[currentHitResult.length -
1].getValue();
// when there is no data, no need to append result if the query is GROUP
BY or output of
// aggregator is partial (final operator will produce NULL result)
if (timeLastValue == PLACEHOLDER_NO_VALUE
- && (groupingKeySize != 0 ||
tableAggregators.get(0).getStep().isOutputPartial())) {
+ && (groupingKeySize != 0
+ || tableAggregators.get(0).getStep().isOutputPartial()
Review Comment:
The comment above this `if` condition is now outdated: the condition also
skips emitting a row for non-grouped `last_by` queries when the cache indicates
the device is empty (`shouldSkipEmptyLastByResult(...)`). Please update the
comment to reflect the additional skip reason so future maintainers don’t
remove or misinterpret this behavior.
--
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]