anishshri-db commented on code in PR #47104:
URL: https://github.com/apache/spark/pull/47104#discussion_r1663215623
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SchemaHelper.scala:
##########
@@ -28,6 +33,61 @@ import org.apache.spark.util.Utils
/**
* Helper classes for reading/writing state schema.
*/
+sealed trait ColumnFamilySchema extends Serializable {
+ def jsonValue: JValue
+
+ def json: String
+
+ def columnFamilyName: String
+}
+
+case class ColumnFamilySchemaV1(
+ columnFamilyName: String,
+ keySchema: StructType,
+ valueSchema: StructType,
+ keyStateEncoderSpec: KeyStateEncoderSpec,
+ multipleValuesPerKey: Boolean,
+ valueEncoder: StructType,
+ userKeyEncoder: Option[StructType] = None) extends ColumnFamilySchema {
+ def jsonValue: JValue = {
+ ("columnFamilyName" -> JString(columnFamilyName)) ~
+ ("keySchema" -> JString(keySchema.json)) ~
+ ("valueSchema" -> JString(valueSchema.json)) ~
+ ("keyStateEncoderSpec" -> keyStateEncoderSpec.jsonValue) ~
+ ("multipleValuesPerKey" -> JBool(multipleValuesPerKey)) ~
Review Comment:
Discussed offline
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]