Skip to content

Commit ade7074

Browse files
committed
explicitly setting nullable = true
1 parent 5452b68 commit ade7074

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/ListStateMetricsImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ trait ListStateMetricsImpl {
3838
// We keep track of the count of entries in the list in a separate column family
3939
// to avoid scanning the entire list to get the count.
4040
private val counterCFValueSchema: StructType =
41-
StructType(Seq(StructField("count", LongType)))
41+
StructType(Seq(StructField("count", LongType, nullable = true)))
4242

4343
private val counterCFProjection = UnsafeProjection.create(counterCFValueSchema)
4444

sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StateStoreColumnFamilySchemaUtils.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object StateStoreColumnFamilySchemaUtils {
4747
// Byte type is converted to Int in Avro, which doesn't work for us as Avro
4848
// uses zig-zag encoding as opposed to big-endian for Ints
4949
Seq(
50-
StructField(s"${field.name}_marker", BinaryType),
50+
StructField(s"${field.name}_marker", BinaryType, nullable = true),
5151
field.copy(name = s"${field.name}_value", BinaryType)
5252
)
5353
} else {
@@ -117,7 +117,7 @@ object StateStoreColumnFamilySchemaUtils {
117117
getRowCounterCFName(stateName), keySchemaId = 0,
118118
keyEncoder.schema,
119119
valueSchemaId = 0,
120-
StructType(Seq(StructField("count", LongType))),
120+
StructType(Seq(StructField("count", LongType, nullable = true))),
121121
Some(NoPrefixKeyStateEncoderSpec(keyEncoder.schema)))
122122
schemas.put(counterSchema.colFamilyName, counterSchema)
123123

@@ -149,7 +149,7 @@ object StateStoreColumnFamilySchemaUtils {
149149
keySchemaId = 0,
150150
keyEncoder.schema,
151151
valueSchemaId = 0,
152-
StructType(Seq(StructField("count", LongType))),
152+
StructType(Seq(StructField("count", LongType, nullable = true))),
153153
Some(NoPrefixKeyStateEncoderSpec(keyEncoder.schema)))
154154
schemas.put(countSchema.colFamilyName, countSchema)
155155
}

0 commit comments

Comments
 (0)