westonpace commented on code in PR #18086:
URL: https://github.com/apache/datafusion/pull/18086#discussion_r2440791141
##########
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:
Added
##########
datafusion/substrait/src/logical_plan/producer/expr/literal.rs:
##########
@@ -94,6 +95,36 @@ pub(crate) fn to_substrait_literal(
LiteralType::I64(*n as i64),
UNSIGNED_INTEGER_TYPE_VARIATION_REF,
),
+ ScalarValue::Float16(Some(f)) => {
+ // Following rules from
https://github.com/apache/arrow/blame/main/format/substrait/extension_types.yaml
Review Comment:
Good idea, switched to permalink
--
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]