jayzhan211 commented on code in PR #24375: URL: https://github.com/apache/datafusion/pull/24375#discussion_r3871572331
########## datafusion/physical-expr/src/expressions/normalize_float_zero.rs: ########## @@ -0,0 +1,255 @@ +// 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. + +//! Floating-point signed-zero normalization expression. + +use std::hash::Hash; +use std::sync::Arc; + +use arrow::datatypes::{DataType, FieldRef, Schema}; +use arrow::record_batch::RecordBatch; +use datafusion_common::Result; +use datafusion_common::utils::{normalize_float_zero, normalize_float_zero_scalar}; +use datafusion_expr::ColumnarValue; +use datafusion_expr::interval_arithmetic::Interval; +use datafusion_expr::sort_properties::ExprProperties; + +use crate::PhysicalExpr; + +/// Replaces floating-point `-0.0` values with `+0.0`. +/// +/// Other values and data types are returned unchanged. This expression is +/// order-preserving but not strictly order-preserving because it collapses the +/// two signed-zero representations. +#[derive(Debug, Eq)] +pub struct NormalizeFloatZeroExpr { Review Comment: I'll take a look at this. My read is that it's handling the edge cases for asof join. One thing I'm worried about: we'd end up with `NormalizeFloatZeroExpr` and `normalize_float_zero` spread across a lot of call sites, which seems likely to cause confusion down the line. Would it make sense to land a minimal PR first — just enough to get a simple asof join working — and then iterate on the other cases after that? What do you think? -- 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]
