You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And then you can get the correct id value 123456789
trino> select * from redisraw.testdb.testrawint;
redis_key | id
----------------------+-----------
testdb:testrawint:aa | 123456789
Question
From the above test, i think trino-redis catalog can not use the raw decoder to query BIGINT/SMALLINT(or other numerical types) value.
This is because the Redis data in the test is always parsed into string type, and then the string type data is converted into bytes. If this byte is further converted into int type(or other numerical types), it will lead to incorrect results.
Here is my test:
Refer to https://trino.io/docs/current/connector/kafka.html#raw-encoder
cat /etc/redis_raw_test/testraw.json
You will find that id is 3544952156018063160 instead of 123456789
And then you can get the correct id value 123456789
Question
From the above test, i think trino-redis catalog can not use the raw decoder to query BIGINT/SMALLINT(or other numerical types) value.
This is because the Redis data in the test is always parsed into string type, and then the string type data is converted into bytes. If this byte is further converted into int type(or other numerical types), it will lead to incorrect results.
trino/plugin/trino-redis/src/main/java/io/trino/plugin/redis/RedisRecordCursor.java
Lines 225 to 235 in 2bc657e
trino/lib/trino-record-decoder/src/main/java/io/trino/decoder/raw/RawColumnDecoder.java
Line 206 in 2bc657e
trino/lib/trino-record-decoder/src/main/java/io/trino/decoder/raw/RawColumnDecoder.java
Lines 249 to 256 in 2bc657e
So, I think trino-redis can only use the raw decoder to query the predefined VARCHAR type value.
WDYT?
https://trino.io/docs/current/connector/redis.html#raw-decoder BTW, the doc shows the raw-decoder can support numerical values. I think it should be removed.
The text was updated successfully, but these errors were encountered: