gabotechs commented on code in PR #18086:
URL: https://github.com/apache/datafusion/pull/18086#discussion_r2434858068
##########
datafusion/substrait/src/logical_plan/consumer/expr/literal.rs:
##########
@@ -474,6 +474,32 @@ pub(crate) fn from_substrait_literal(
.get(&user_defined.type_reference)
{
match name.as_ref() {
+ FLOAT_16_TYPE_NAME => {
+ let Some(value) = user_defined.val.as_ref() else {
+ return substrait_err!("Float16 value is empty");
+ };
+ let Val::Value(value_any) = value else {
+ return substrait_err!(
+ "Float16 value is not a value type literal"
+ );
+ };
+ if value_any.type_url != "google.protobuf.UInt32Value"
{
+ return substrait_err!(
+ "Float16 value is not a
google.protobuf.UInt32Value"
+ );
+ }
Review Comment:
What do you think about having a similar comment like the one you added in
the producer here? at first it looked confusing that we are using an Uint32 for
sending a Float16 over the wire, but after reading the comment in
`datafusion/substrait/src/logical_plan/producer/expr/literal.rs:99` it makes
sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]