当数字作为字符串小于零时,将其转换为整数,但如果大于零,则将其转换为十进制。为什么会这样?
spark.sql("select case when '1.24' > 1.23 then 1 else 0 end as test").show()
+----+
|test|
+----+
| 1|
+----+
spark.sql("select case when '0.24' > 0 then 1 else 0 end as test").show()
+----+
|test|
+----+
| 0|
+----+