anishshri-db commented on code in PR #48401:
URL: https://github.com/apache/spark/pull/48401#discussion_r1835181294


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateEncoder.scala:
##########
@@ -563,13 +684,113 @@ class RangeKeyScanStateEncoder(
     writer.getRow()
   }
 
+  def encodePrefixKeyForRangeScan(
+      row: UnsafeRow, avroType: Schema): Array[Byte] = {
+    val record = new GenericData.Record(avroType)
+    var fieldIdx = 0
+    rangeScanKeyFieldsWithOrdinal.zipWithIndex.foreach { case 
(fieldWithOrdinal, idx) =>
+      val field = fieldWithOrdinal._1
+      val value = row.get(idx, field.dataType)
+      if (value == null) {
+        record.put(fieldIdx, false) // isNull marker
+        record.put(fieldIdx + 1, new Array[Byte](field.dataType.defaultSize))
+      } else {
+        field.dataType match {
+          case LongType =>

Review Comment:
   should we support all the types similar to the unsafe row encoder ?



-- 
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]

Reply via email to