Skip to content

Commit e32eb31

Browse files
authored
doc: change some comment for scalar regex matching
1 parent bd78edb commit e32eb31

File tree

1 file changed

+4
-3
lines changed
  • datafusion/physical-expr/src/expressions

1 file changed

+4
-3
lines changed

datafusion/physical-expr/src/expressions/binary.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ pub struct BinaryExpr {
5454
right: Arc<dyn PhysicalExpr>,
5555
/// Specifies whether an error is returned on overflow or not
5656
fail_on_overflow: bool,
57-
/// precompiled regexp pattern
57+
/// Only used when evaluating literal regex expressions. Example regex expression: c1 ~ '^a'
58+
/// It's helpful saving time of compiling literal pattern string for each execution.
5859
precompiled_regexp: Option<regex::Regex>,
5960
}
6061

@@ -101,7 +102,7 @@ impl BinaryExpr {
101102
&self.op
102103
}
103104

104-
/// precomile literal regexp pattern
105+
/// Get pre-compiled regexp
105106
fn precompile_regexp_pattern(op: &Operator, lit: &Arc<dyn PhysicalExpr>) -> Option<regex::Regex> {
106107
match op {
107108
Operator::RegexMatch |
@@ -713,7 +714,7 @@ pub fn binary(
713714
Ok(Arc::new(BinaryExpr::new(lhs, op, rhs)))
714715
}
715716

716-
/// copy from arrow::compute::kernels::comparison::regexp_scalar_match
717+
/// It is used for scalar regexp matching
717718
fn regexp_scalar_match<OffsetSize: OffsetSizeTrait>(
718719
array: &GenericStringArray<OffsetSize>,
719720
regex: &regex::Regex,

0 commit comments

Comments
 (0)