andygrove commented on code in PR #17037:
URL: https://github.com/apache/datafusion/pull/17037#discussion_r2260434271


##########
datafusion/spark/src/function/string/regexp_extract.rs:
##########
@@ -0,0 +1,265 @@
+// 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.
+
+//! Regex expressions
+
+use std::any::Any;
+use std::collections::{hash_map::Entry, HashMap};
+use std::sync::Arc;
+
+use arrow::array::builder::GenericStringBuilder;
+use arrow::array::{
+    Array, ArrayRef, OffsetSizeTrait, PrimitiveArray, StringArrayType, 
UInt32Array,
+};
+use arrow::datatypes::{DataType, Field, FieldRef, UInt32Type};
+use datafusion_common::cast::{
+    as_generic_string_array, as_string_view_array, as_uint32_array,
+};
+use datafusion_common::{internal_err, DataFusionError, Result};
+use datafusion_expr::{
+    ColumnarValue, ReturnFieldArgs, ScalarFunctionArgs, ScalarUDFImpl, 
Signature,
+    TypeSignature, Volatility,
+};
+use datafusion_functions::utils::make_scalar_function;
+use regex::Regex;
+
+/// REGEXP_EXTRACT function extracts the first string in the str that match
+/// the regexp expression and corresponding to the regex group index.
+/// <https://spark.apache.org/docs/latest/api/sql/#regexp_extract>

Review Comment:
   It may be worth adding documentation to explain that there are differences 
between Java's regex engine and Rust's regex engine, so users should not expect 
100% compatibility



-- 
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

Reply via email to