[
https://issues.apache.org/jira/browse/FLINK-2203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584637#comment-14584637
]
ASF GitHub Bot commented on FLINK-2203:
---------------------------------------
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/831#discussion_r32371124
--- Diff:
flink-staging/flink-table/src/main/scala/org/apache/flink/api/table/typeinfo/RowSerializer.scala
---
@@ -102,20 +119,39 @@ class RowSerializer(fieldSerializers:
Array[TypeSerializer[Any]])
val len = fieldSerializers.length
val result = new Row(len)
- var i = 0
- while (i < len) {
- result.setField(i, fieldSerializers(i).deserialize(source))
- i += 1
+
+ var index = 0
+ while (index < len) {
+ val isNull: Boolean = source.readBoolean()
+ if (isNull) {
+ result.setField(index, null)
+ } else {
+ val serializer: TypeSerializer[Any] = fieldSerializers(index)
+ result.setField(index, serializer.deserialize(source))
+ }
+ index += 1
}
result
}
+ private final val booleanSerializer = new BooleanSerializer()
+
override def copy(source: DataInputView, target: DataOutputView): Unit =
{
val len = fieldSerializers.length
var i = 0
while (i < len) {
+ booleanSerializer.copy(source, target)
--- End diff --
I think it would be easier to do
```
target.writeBoolean(source.readBoolean())
```
here, instead of going through the extra abstraction of the
BooleanSerializer.
> Add Support for Null-Values in RowSerializer
> --------------------------------------------
>
> Key: FLINK-2203
> URL: https://issues.apache.org/jira/browse/FLINK-2203
> Project: Flink
> Issue Type: Improvement
> Components: Table API
> Reporter: Aljoscha Krettek
> Assignee: Shiti Saxena
> Priority: Minor
> Labels: Starter
>
> This would be a start towards proper handling of null values. We would still
> need to add support for null values in aggregations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)