paleolimbot commented on code in PR #21291: URL: https://github.com/apache/datafusion/pull/21291#discussion_r3025481991
########## datafusion/common/src/types/canonical_extensions/bool8.rs: ########## @@ -0,0 +1,133 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +use crate::error::_internal_err; +use crate::types::extension::DFExtensionType; +use arrow::array::{Array, Int8Array}; +use arrow::datatypes::DataType; +use arrow::util::display::{ArrayFormatter, DisplayIndex, FormatOptions, FormatResult}; +use arrow_schema::ArrowError; +use arrow_schema::extension::{Bool8, ExtensionType}; +use std::fmt::Write; + +/// Defines the extension type logic for the canonical `arrow.bool8` extension type. +/// +/// See [`DFExtensionType`] for information on DataFusion's extension type mechanism. +#[derive(Debug, Clone)] +pub struct DFBool8(Bool8); + +impl ExtensionType for DFBool8 { + const NAME: &'static str = Bool8::NAME; + type Metadata = <Bool8 as ExtensionType>::Metadata; Review Comment: I'm not sure this is needed (only the `impl DFExtensionType` bit). Does the fact that these objects implement `ExtensionType` allow something to be done with them that isn't otherwise possible? -- 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]
