You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Lordworms (via GitHub)" <gi...@apache.org> on 2024/02/29 02:38:26 UTC

[PR] port regexp_like function and port related tests [arrow-datafusion]

Lordworms opened a new pull request, #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397

   ## Which issue does this PR close?
   #9328  part II
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510016507


##########
datafusion/physical-expr/benches/regexp.rs:
##########
@@ -78,20 +74,6 @@ fn flags(rng: &mut ThreadRng) -> StringArray {
 }
 
 fn criterion_benchmark(c: &mut Criterion) {

Review Comment:
   I will file another PR to finish port regx_replace and delete this bench later today



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "yyy1000 (via GitHub)" <gi...@apache.org>.
yyy1000 commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1509999190


##########
datafusion/functions/src/regex/regexplike.rs:
##########
@@ -0,0 +1,252 @@
+// 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.
+
+//! Encoding expressions

Review Comment:
   I checked the repo and thought it may be a small typo, and it also appears in the previous `regex` function.
   It's not related to `Encoding expressions`



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510013736


##########
datafusion/physical-expr/benches/regexp.rs:
##########
@@ -23,15 +23,12 @@ use std::sync::Arc;
 use arrow_array::builder::StringBuilder;
 use arrow_array::{ArrayRef, StringArray};
 use criterion::{black_box, criterion_group, criterion_main, Criterion};
+use datafusion_functions::regex::regexplike::regexp_like;

Review Comment:
   I agree that it would be a great idea. Should I port all other regexp benchmark in this PR or in the following one? I will port regexp_like first



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510008639


##########
datafusion/physical-expr/Cargo.toml:
##########
@@ -61,6 +61,7 @@ chrono = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   I will verify it , Thanks



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "yyy1000 (via GitHub)" <gi...@apache.org>.
yyy1000 commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1509999190


##########
datafusion/functions/src/regex/regexplike.rs:
##########
@@ -0,0 +1,252 @@
+// 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.
+
+//! Encoding expressions

Review Comment:
   I checked the repo and thought it may be a small typo, and it also appears in the previous `regex` function.



##########
datafusion/physical-expr/Cargo.toml:
##########
@@ -61,6 +61,7 @@ chrono = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   Can it be moved into `dev-dependencies`? I didn't verify and just be curious.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510008598


##########
datafusion/functions/src/regex/regexplike.rs:
##########
@@ -0,0 +1,252 @@
+// 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.
+
+//! Encoding expressions

Review Comment:
   Thanks buddy, I will fix it



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510009696


##########
datafusion/physical-expr/benches/regexp.rs:
##########
@@ -23,15 +23,12 @@ use std::sync::Arc;
 use arrow_array::builder::StringBuilder;
 use arrow_array::{ArrayRef, StringArray};
 use criterion::{black_box, criterion_group, criterion_main, Criterion};
+use datafusion_functions::regex::regexplike::regexp_like;

Review Comment:
   Rather than making this dependency, I think we could instead move the benchmark (for regexp_like) to datafusion/functions/benches/regex.rs?



##########
datafusion/physical-expr/Cargo.toml:
##########
@@ -61,6 +61,7 @@ chrono = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   I don't think we should have a dependence between datafusion-functions and datafusion-physical-exprs as we are trying to make the crates more indenpendent. I commented below on some ways to avoid this dependency



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on code in PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#discussion_r1510013557


##########
datafusion/physical-expr/Cargo.toml:
##########
@@ -61,6 +61,7 @@ chrono = { workspace = true }
 datafusion-common = { workspace = true, default-features = true }
 datafusion-execution = { workspace = true }
 datafusion-expr = { workspace = true }
+datafusion-functions = { workspace = true }

Review Comment:
   Got it



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#issuecomment-1975099958

   My ClickBench benchmark run shows no significant change:
   
   <details><summary>Details</summary>
   <p>
   
   ```
   --------------------
   Benchmark clickbench_1.json
   --------------------
   ┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
   ┃ Query        ┃  main_base ┃ issue_9328_2 ┃        Change ┃
   ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
   │ QQuery 0     │     0.77ms │       0.75ms │     no change │
   │ QQuery 1     │    85.19ms │      87.65ms │     no change │
   │ QQuery 2     │   185.70ms │     188.47ms │     no change │
   │ QQuery 3     │   203.55ms │     202.47ms │     no change │
   │ QQuery 4     │  2014.07ms │    1993.45ms │     no change │
   │ QQuery 5     │  1835.24ms │    1883.81ms │     no change │
   │ QQuery 6     │    84.19ms │      82.70ms │     no change │
   │ QQuery 7     │    90.61ms │      90.52ms │     no change │
   │ QQuery 8     │  3012.36ms │    2982.53ms │     no change │
   │ QQuery 9     │  2226.45ms │    2153.82ms │     no change │
   │ QQuery 10    │   797.30ms │     798.08ms │     no change │
   │ QQuery 11    │   885.18ms │     882.21ms │     no change │
   │ QQuery 12    │  1996.77ms │    2002.07ms │     no change │
   │ QQuery 13    │  4340.28ms │    4215.03ms │     no change │
   │ QQuery 14    │  2652.14ms │    2645.28ms │     no change │
   │ QQuery 15    │  2230.46ms │    2212.42ms │     no change │
   │ QQuery 16    │  5533.51ms │    5411.94ms │     no change │
   │ QQuery 17    │  5419.85ms │    5256.58ms │     no change │
   │ QQuery 18    │ 11082.06ms │   10974.93ms │     no change │
   │ QQuery 19    │   160.32ms │     159.33ms │     no change │
   │ QQuery 20    │  2525.27ms │    2560.97ms │     no change │
   │ QQuery 21    │  3329.14ms │    3289.60ms │     no change │
   │ QQuery 22    │  9023.08ms │    8949.14ms │     no change │
   │ QQuery 23    │ 21485.68ms │   21301.62ms │     no change │
   │ QQuery 24    │  1337.12ms │    1319.03ms │     no change │
   │ QQuery 25    │  1139.19ms │    1137.60ms │     no change │
   │ QQuery 26    │  1438.28ms │    1424.81ms │     no change │
   │ QQuery 27    │  3805.54ms │    3801.18ms │     no change │
   │ QQuery 28    │ 30573.75ms │   30438.09ms │     no change │
   │ QQuery 29    │  1055.06ms │    1038.96ms │     no change │
   │ QQuery 30    │  2395.69ms │    2332.10ms │     no change │
   │ QQuery 31    │  3131.58ms │    3007.00ms │     no change │
   │ QQuery 32    │ 15260.30ms │   15058.24ms │     no change │
   │ QQuery 33    │  8760.71ms │    8810.44ms │     no change │
   │ QQuery 34    │ 13080.73ms │   12910.91ms │     no change │
   │ QQuery 35    │  3627.75ms │    3601.54ms │     no change │
   │ QQuery 36    │   332.65ms │     315.64ms │ +1.05x faster │
   │ QQuery 37    │   219.30ms │     221.42ms │     no change │
   │ QQuery 38    │   186.01ms │     189.70ms │     no change │
   │ QQuery 39    │  1085.73ms │    1061.86ms │     no change │
   │ QQuery 40    │    85.20ms │      86.09ms │     no change │
   │ QQuery 41    │    78.69ms │      80.66ms │     no change │
   │ QQuery 42    │    90.88ms │      91.84ms │     no change │
   └──────────────┴────────────┴──────────────┴───────────────┘
   ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
   ┃ Benchmark Summary           ┃             ┃
   ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
   │ Total Time (main_base)      │ 168883.32ms │
   │ Total Time (issue_9328_2)   │ 167252.48ms │
   │ Average Time (main_base)    │   3927.52ms │
   │ Average Time (issue_9328_2) │   3889.59ms │
   │ Queries Faster              │           1 │
   │ Queries Slower              │           0 │
   │ Queries with No Change      │          42 │
   └─────────────────────────────┴─────────────┘
   ```
   
   </p>
   </details> 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] port regexp_like function and port related tests [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #9397:
URL: https://github.com/apache/arrow-datafusion/pull/9397#issuecomment-1976332094

   Thanks again @Lordworms 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org