You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/13 19:27:44 UTC

[GitHub] [arrow] projjal commented on a change in pull request #10518: ARROW-13052: [C++][Gandiva] Implements REGEXP_EXTRACT function

projjal commented on a change in pull request #10518:
URL: https://github.com/apache/arrow/pull/10518#discussion_r669049098



##########
File path: cpp/src/gandiva/string_function_holder_test.cc
##########
@@ -212,6 +213,189 @@ TEST_F(TestLikeHolder, TestMultipleEscapeChar) {
   auto status = LikeHolder::Make("ab\\_", "\\\\", &like_holder);
   EXPECT_EQ(status.ok(), false) << status.message();
 }
+
+// Tests related to the REGEXP_EXTRACT function
+class TestExtractHolder : public ::testing::Test {
+ protected:
+  ExecutionContext execution_context_;
+};
+
+TEST_F(TestExtractHolder, TestSimpleExtract) {
+  std::shared_ptr<ExtractHolder> extract_holder;
+
+  // Pattern to match of two group of letters
+  auto status = ExtractHolder::Make(R"((\w+) (\w+))", &extract_holder);

Review comment:
       Shouldn't this be R"(\w+) (\w+)" since you are enclosing another bracket inside the constructor?
   So in your example index 2 should return first name?




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