Closed RichardFlyBird closed 2 years ago
INT96 stored in parquet-go as a stirng([]byte), which are the encoded bytes.
If your INT96 is just a number, you should convert it to readable string by yourself.
If your INT96 is a timestamp, you can use the types.INT96ToTime
. This function is compatible with Spark output. You can refer from here
INT96 stored in parquet-go as a stirng([]byte), which are the encoded bytes. If your INT96 is just a number, you should convert it to readable string by yourself. If your INT96 is a timestamp, you can use the
types.INT96ToTime
. This function is compatible with Spark output. You can refer from here
My INT96 is a timestamp, and I know it's real value = '2021/9/18 18:31:46'. But when I use types.INT96ToTime to transfer the INT96(as a stirng([]byte)) ,the result value is '1925-01-01 00:12:21'. I suspect that the data retrieved from pr.ReadByNumber(step) is wrong, i don't know why does this happen?
I'm not sure. How did you generate this parquet file ? Could you provide a sample file ?
code as follow:
when i have executed follow codes:
I know one field is int96 type before, so when i get the int96 type field in jsonBs, the result is 18bytes, not 12bites. And when i use time := types.INT96ToTime(int96_value.(string)), the result is obviously wrong. Is my usage incorrect? I'm in a hurry, thanks so much