tustvold opened a new issue #1276: URL: https://github.com/apache/arrow-rs/issues/1276
**Is your feature request related to a problem or challenge? Please describe what you are trying to do.** It is possible to call `get_decoder` with any `T: DataType` and a corresponding `Encoding`, even if that `Encoding` doesn't make sense for that type. For example ``` get_decoder::<Int32Type>(Encoding::DELTA_LENGTH_BYTE_ARRAY, ...) get_decoder::<Int32Type>(Encoding::RLE, ...) get_decoder::<FloatType>(Encoding::DELTA_BINARY_PACKED, ...) ``` These will error, or in some case panic, if an attempt is made to use them but it would be better to return an error on construction. **Describe the solution you'd like** Attempting to use an incompatible encoding with a given type should return an error on construction. **Additional context** An additional challenge with the current setup is that it makes the implicit assumption that a Decoder must be able to be created for all `DataType` even if it doesn't make sense for most types. This makes for some rather confusing code, and prevents decoders from adding constraints that may be true for all valid types, but not all types in general, (e.g. num::FromPrimitive). -- 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]
