MCPcopy Create free account
hub / github.com/apache/datafusion / cast_storage_to

Method cast_storage_to

datafusion/common/src/metadata.rs:58–64  ·  view source on GitHub ↗

Cast this values's storage type This operation assumes that if the underlying [ScalarValue] can be casted to a given type that any extension type represented by the metadata is also valid.

(
        &self,
        target_type: &DataType,
    )

Source from the content-addressed store, hash-verified

56 /// to a given type that any extension type represented by the metadata is also
57 /// valid.
58 pub fn cast_storage_to(
59 &self,
60 target_type: &DataType,
61 ) -> Result<Self, DataFusionError> {
62 let new_value = self.value().cast_to(target_type)?;
63 Ok(Self::new(new_value, self.metadata.clone()))
64 }
65}
66
67/// create a new ScalarAndMetadata from a ScalarValue without

Callers 1

execute_preparedMethod · 0.80

Calls 4

newFunction · 0.85
cast_toMethod · 0.45
valueMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected