0

I'm write a dataframe to redis and read the data with spring boot application. The information retry successfull, but the id column return null like that:

{ "nu_document": null, "qt_negative": "1000000000" }

Alan Miranda
  • 125
  • 1
  • 8

1 Answers1

0

Had same issue. you might be missing

.option("key.column", "nu_document")

from your read method. Check out the link https://github.com/RedisLabs/spark-redis/blob/master/doc/dataframe.md.

Avisha
  • 41
  • 12
  • My write code ==> df.write.format("org.apache.spark.sql.redis").option("table", "summary").option("key.column", "nu_document").mode(SaveMode.Append).save() – Alan Miranda May 23 '22 at 22:03
  • yeah that is right. but you need to mention the key column in the read method too if that is missing. – Avisha May 24 '22 at 05:14
  • but, I'm not read with spark, I'm reading with spring boot, i said above in the question. – Alan Miranda May 24 '22 at 14:15
  • oh sorry. my bad. i was working with Spark. So was thinking on the same track. – Avisha May 25 '22 at 15:25
  • my repository ==> personRepository.findById(id). The return is {"nu_document": null, "qt_negative": "1000000000"}. so nu_documento is null – Alan Miranda May 25 '22 at 21:38