fsk119 commented on code in PR #22599:
URL: https://github.com/apache/flink/pull/22599#discussion_r1198686686


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/aggregate/LagAggFunction.java:
##########
@@ -44,6 +44,11 @@ public LagAggFunction(LogicalType[] valueTypes) {
                 Arrays.stream(valueTypes)
                         .map(DataTypeUtils::toInternalDataType)
                         .toArray(DataType[]::new);
+        //When the initial value has not been initialized and is not allowed 
to be null,
+        // it should be changed to allow nulls
+        if (valueDataTypes.length < 3 && 
!valueDataTypes[0].getLogicalType().isNullable()) {
+            valueDataTypes[0] = valueDataTypes[0].nullable();
+        }

Review Comment:
   If user specify the lag(a, 1, null), the type of the first argument should 
be nullable.



-- 
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