We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The org.msgpack.core.MessageTypeCastException would be thrown when the results of the td query contains DECIMAL type.
org.msgpack.core.MessageTypeCastException
This exception cause by the following reason.
Since the DECIMAL type "columns" are interpreted as embulks DOUBLE type, https://github.com/treasure-data/embulk-input-td/blob/v0.2.3/src/main/java/org/embulk/input/td/TdInputPlugin.java#L233
however the DECIMAL type "data fields" are packed and unpacked as MessagePack's String type.
ex. This query
SELECT * FROM ( VALUES DECIMAL '0.0' ) AS t (dec)
would yeid the msgpack serialized bytes sequence 0x91 0xA3 0x30 0x2E 0x30, and deserialized as fixstr type (first byte 0xa0 - 0xbf)
0x91 0xA3 0x30 0x2E 0x30
fixstr
0xa0
0xbf
And for the ImmutableStringValue, it doesn't support asFloatValue() and will end up with throwing the MessageTypeCastException.
ImmutableStringValue
asFloatValue()
MessageTypeCastException
The following is the testing environment I used to reproduce the issue.
in: type: td apikey: [MY_API_KEY] database: [MY_DB] query: | SELECT * FROM ( VALUES DECIMAL '0.0' ) AS t (dec) out: type: stdout
embulk preview config.yml
The text was updated successfully, but these errors were encountered:
I had the same issue.
Sorry, something went wrong.
No branches or pull requests
The
org.msgpack.core.MessageTypeCastException
would be thrown when the results of the td query contains DECIMAL type.This exception cause by the following reason.
Since the DECIMAL type "columns" are interpreted as embulks DOUBLE type,
https://github.com/treasure-data/embulk-input-td/blob/v0.2.3/src/main/java/org/embulk/input/td/TdInputPlugin.java#L233
however the DECIMAL type "data fields" are packed and unpacked as MessagePack's String type.
ex.
This query
would yeid the msgpack serialized bytes sequence
0x91 0xA3 0x30 0x2E 0x30
,and deserialized as
fixstr
type (first byte0xa0
-0xbf
)And for the
ImmutableStringValue
, it doesn't supportasFloatValue()
and will end up with throwing theMessageTypeCastException
.The following is the testing environment I used to reproduce the issue.
embulk preview config.yml
The text was updated successfully, but these errors were encountered: