Skip to content

Commit

Permalink
explicitly setting nullable = true
Browse files Browse the repository at this point in the history
  • Loading branch information
ericm-db committed Feb 6, 2025
1 parent 5452b68 commit ade7074
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ trait ListStateMetricsImpl {
// We keep track of the count of entries in the list in a separate column family
// to avoid scanning the entire list to get the count.
private val counterCFValueSchema: StructType =
StructType(Seq(StructField("count", LongType)))
StructType(Seq(StructField("count", LongType, nullable = true)))

private val counterCFProjection = UnsafeProjection.create(counterCFValueSchema)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object StateStoreColumnFamilySchemaUtils {
// Byte type is converted to Int in Avro, which doesn't work for us as Avro
// uses zig-zag encoding as opposed to big-endian for Ints
Seq(
StructField(s"${field.name}_marker", BinaryType),
StructField(s"${field.name}_marker", BinaryType, nullable = true),
field.copy(name = s"${field.name}_value", BinaryType)
)
} else {
Expand Down Expand Up @@ -117,7 +117,7 @@ object StateStoreColumnFamilySchemaUtils {
getRowCounterCFName(stateName), keySchemaId = 0,
keyEncoder.schema,
valueSchemaId = 0,
StructType(Seq(StructField("count", LongType))),
StructType(Seq(StructField("count", LongType, nullable = true))),
Some(NoPrefixKeyStateEncoderSpec(keyEncoder.schema)))
schemas.put(counterSchema.colFamilyName, counterSchema)

Expand Down Expand Up @@ -149,7 +149,7 @@ object StateStoreColumnFamilySchemaUtils {
keySchemaId = 0,
keyEncoder.schema,
valueSchemaId = 0,
StructType(Seq(StructField("count", LongType))),
StructType(Seq(StructField("count", LongType, nullable = true))),
Some(NoPrefixKeyStateEncoderSpec(keyEncoder.schema)))
schemas.put(countSchema.colFamilyName, countSchema)
}
Expand Down

0 comments on commit ade7074

Please sign in to comment.