You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tw...@apache.org on 2021/11/05 17:14:58 UTC
[flink] branch master updated: [hotfix][table-common] Fix
nullability for DataTypeUtils.appendRowFields
This is an automated email from the ASF dual-hosted git repository.
twalthr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new 2a582f3 [hotfix][table-common] Fix nullability for DataTypeUtils.appendRowFields
2a582f3 is described below
commit 2a582f3392f7f38e7c318fb76017a21fe338be2a
Author: Timo Walther <tw...@apache.org>
AuthorDate: Fri Nov 5 18:13:45 2021 +0100
[hotfix][table-common] Fix nullability for DataTypeUtils.appendRowFields
---
.../java/org/apache/flink/table/types/utils/DataTypeUtils.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/DataTypeUtils.java b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/DataTypeUtils.java
index 4380761..f333b18 100644
--- a/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/DataTypeUtils.java
+++ b/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/DataTypeUtils.java
@@ -162,8 +162,13 @@ public final class DataTypeUtils {
if (fields.size() == 0) {
return dataType;
}
- return Stream.concat(DataType.getFields(dataType).stream(), fields.stream())
- .collect(Collectors.collectingAndThen(Collectors.toList(), DataTypes::ROW));
+ DataType newRow =
+ Stream.concat(DataType.getFields(dataType).stream(), fields.stream())
+ .collect(Collectors.collectingAndThen(Collectors.toList(), DataTypes::ROW));
+ if (!dataType.getLogicalType().isNullable()) {
+ newRow = newRow.notNull();
+ }
+ return newRow;
}
/**