We don’t have any bit-level casting operations in SingleStoreDB, but you may be able to work around it. If you can convert something to a number, you can do:
json_array_pack_i64(‘[ number_as_string ]’)
to get a blob with the number in it. Then you can use HEX() to get the hex value of that.
So you can try
hex(json_array_pack_i64(concat(‘[’, unix_timestamp( timestamp_value ), ‘]’))
I was able to get the hex value in the way you told me, but I don’t know if the value matches the value stored in the singlestoredb blob file.
Sometimes user want to see stored values as-is for troubleshooting purposes. Unfortunately, singlestoredb tends to implicitly convert to string, which makes analysis difficult.
I expected hex( ) to do that, but it doesn’t.
How about adding a feature to dump column values for diagnostic purposes?
We have an internal feature request for something equivalent to a reinterpret_cast in C++, where you could cast to/from different types directly in binary. I put your use case on it for tracking. We’ll keep an eye on it. For now, I’m glad the approach using json_array_pack worked for you.