Decoding and Encoding Double value in Python

I would like to encode a double value like this:

DF1=spark.sql(f"""SELECT base64(aes_encrypt(bin(3.5),"123456789yxcvbnm")) as m""")
k=DF1.first()['m'] 

Now I want to decode this value, but it returns me the other value:

DF2=spark.sql(f"""SELECT float(string(aes_decrypt(unbase64("{k}"),"123456789yxcvbnm"))) as m2""")
DF2.first()['m2'] //It returns me 11!!!

What is my failure here? how can I decode this value correctly?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.