RedisGears / rghibernate

A Write-Behind and Write-Through recipe for RedisGears using Hibernate
https://redisgears.io
Other
9 stars 7 forks source link

Read through fails to read rows with NULL values #88

Closed shkediy closed 2 years ago

shkediy commented 2 years ago

If a row in the database contains a null value for some column that does not have not-null property set to true (meaning that it can have a null value), read through fails to read that row. to reproduce, insert a row that have a null value for some property, then try "hgetall ". The command returns: (empty array)

The RG.GETEXUCUTION output show: 1) 1) "shard_id" 2) "0000000000000000000000000000000000000144" 3) "execution_plan" 4) 1) "status" 2) "done" 3) "shards_received" 4) (integer) 0 5) "shards_completed" 6) (integer) 0 7) "results" 8) (integer) 0 9) "errors" 10) 1) "java.lang.NullPointerException|\tat com.redislabs.PropertyData.convertToStr(PropertyData.java:64)|\tat com.redislabs.ReadSource.foreach(ReadSource.java:87)|\tat com.redislabs.ReadSource.foreach(ReadSource.java:18)|" 11) "total_duration" 12) (integer) 1221 13) "read_duration" 14) (integer) 0 15) "steps" 16) 1) 1) "type" 2) "foreach" 3) "duration" 4) (integer) 0 5) "name" 6) "JVM_Foreach" 7) "arg" 8) "java object" 2) 1) "type" 2) "map" 3) "duration" 4) (integer) 0 5) "name" 6) "JVM_ToJavaRecordMapper" 7) "arg" 8) ""

It looks like it throws an exception when trying to convert the null value to string. It should ignore a null value.