Skip to content

Commit

Permalink
adding scaladoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ericm-db committed Nov 15, 2024
1 parent 141f780 commit 2b4fd89
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,16 @@ class StateStoreColumnFamilySchemaUtils(initializeAvroSerde: Boolean)
))
}

// This function creates the StateStoreColFamilySchema for
// Timers' secondary index.
// Because we want to encode fixed-length types as binary types
// if we are using Avro, we need to do some schema conversion to ensure
// we can use range scan
/** Creates a StateStoreColFamilySchema for Timers' secondary index with proper encoding configuration.
*
* When using Avro encoding, fixed-length types need to be converted to binary types to support range scan operations.
* This function handles the necessary schema conversion to ensure range scan functionality works correctly.
*
* @param stateName The name of the state store
* @param keySchema The schema defining the structure of the key
* @param valSchema The schema defining the structure of the value
* @return A StateStoreColFamilySchema configured for Timer secondary indexing with appropriate encoding
*/
def getTimerStateSchemaForSecIndex(
stateName: String,
keySchema: StructType,
Expand All @@ -290,7 +295,7 @@ class StateStoreColumnFamilySchemaUtils(initializeAvroSerde: Boolean)
valSchema,
Some(RangeKeyScanStateEncoderSpec(keySchema, Seq(0))),
avroEnc = getAvroSerde(
StructType(avroKeySchema.drop(2)),
StructType(avroKeySchema.drop(numRemainingKeyFieldsForTtlRangeScan)),
valSchema
))
}
Expand Down

0 comments on commit 2b4fd89

Please sign in to comment.