jayzhan211 commented on issue #12622: URL: https://github.com/apache/datafusion/issues/12622#issuecomment-2638782736
> There should be no function for creating a ScalarValue from a physical object or DataType. I think getting `Scalar` from `DataType` or `ArrayRef` makes sense, so the restriction of this doesn't seem sound to me. `Scalar::try_from(DataType::Utf8View).into_value()` lost the `DataType` so it should only be used if we don't care about the `DataType`. > The problem with both approaches is that, once a test case fails, all debugging happens at runtime Is it possible to carry `Scalar` along where we know the `DataType`? If not, what might be the case? > There should be no method for creating a physical object from a ScalarValue without a DataType This makes sense to me. Getting `Array` from `ScalarValue` is valid since physical type is tightly coupled by `ScalarValue`. When we switch to `Scalar`, `ScalarValue` no longer contains physical type, so we can only transform `Scalar` which contains `DataType` to `Array`. > Scalar{ value: ScalarValue::Utf8("test"), data_type: DataType::Utf8View}.into_value().to_array() I agree, this is incorrect since `into_value()` no longer contains `DataType` so we can only call `to_array()` from `Scalar`. I think the approach you mentioned are only possible if `Scalar` exists? Do you have any idea that is possible to work on `main` branch? -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org