[jira] [Updated] (NIFI-2072) Support named captures in ExtractText
[ https://issues.apache.org/jira/browse/NIFI-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Otto Fowler updated NIFI-2072: -- Labels: extracttext (was: ) > Support named captures in ExtractText > - > > Key: NIFI-2072 > URL: https://issues.apache.org/jira/browse/NIFI-2072 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Joey Frazee >Assignee: Otto Fowler >Priority: Major > Labels: extracttext > > ExtractText currently captures and creates attributes using numeric indices > (e.g, attribute.name.0, attribute.name.1, etc.) whether or not the capture > groups are named, i.e., patterns like (?\w+). > In addition to being more faithful to the provided regexes, named captures > could help simplify data flows because you wouldn't have to add superfluous > UpdateAttribute steps which are just renaming the indexed captures to more > interpretable names. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (NIFI-2072) Support named captures in ExtractText
[ https://issues.apache.org/jira/browse/NIFI-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Otto Fowler updated NIFI-2072: -- Status: Patch Available (was: In Progress) [l#4348|https://github.com/apache/nifi/pull/4384/] > Support named captures in ExtractText > - > > Key: NIFI-2072 > URL: https://issues.apache.org/jira/browse/NIFI-2072 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Joey Frazee >Assignee: Otto Fowler >Priority: Major > > ExtractText currently captures and creates attributes using numeric indices > (e.g, attribute.name.0, attribute.name.1, etc.) whether or not the capture > groups are named, i.e., patterns like (?\w+). > In addition to being more faithful to the provided regexes, named captures > could help simplify data flows because you wouldn't have to add superfluous > UpdateAttribute steps which are just renaming the indexed captures to more > interpretable names. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [nifi] ottobackwards commented on a change in pull request #4384: NIFI-2702 Support named captures in ExtractText
ottobackwards commented on a change in pull request #4384: URL: https://github.com/apache/nifi/pull/4384#discussion_r449724719 ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExtractTextNamedGroups.java ## @@ -0,0 +1,383 @@ +/* + * 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. + */ Review comment: The same tests related to capture from TestExtractText 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi] ottobackwards commented on a change in pull request #4384: NIFI-2702 Support named captures in ExtractText
ottobackwards commented on a change in pull request #4384: URL: https://github.com/apache/nifi/pull/4384#discussion_r449724719 ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestExtractTextNamedGroups.java ## @@ -0,0 +1,383 @@ +/* + * 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. + */ Review comment: The same tests related to capture from TestExtractText, Although adapted to the difference in output 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi] ottobackwards commented on a change in pull request #4384: NIFI-2702 Support named captures in ExtractText
ottobackwards commented on a change in pull request #4384: URL: https://github.com/apache/nifi/pull/4384#discussion_r449724622 ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java ## @@ -16,6 +16,8 @@ */ package org.apache.nifi.processors.standard; Review comment: This is already included in the car ## File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java ## @@ -16,6 +16,8 @@ */ package org.apache.nifi.processors.standard; Review comment: This is already included in the nar 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [nifi] ottobackwards opened a new pull request #4384: NIFI-2702 Support named captures in ExtractText
ottobackwards opened a new pull request #4384: URL: https://github.com/apache/nifi/pull/4384 Thank you for submitting a contribution to Apache NiFi. Please provide a short description of the PR here: Description of PR Enables ExtractText to support creating attributes named by named group captures. ### For all changes: - [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with **NIFI-** where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [x] Has your PR been rebased against the latest commit within the target branch (typically `master`)? - [x] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._ ### For code changes: - [x] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder? - [x] Have you written or updated unit tests to verify your changes? - [x] Have you verified that the full build is successful on JDK 8? - [-] Have you verified that the full build is successful on JDK 11? - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [-] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`? - [-] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`? - [x] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [x ] Have you ensured that format looks appropriate for the output in which it is rendered? NOTE: the original did not look great. This is equally as bad. ### Note: Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[jira] [Created] (NIFI-7599) JMSConsumer sets no-local for all TOPIC destinations
Joey Frazee created NIFI-7599: - Summary: JMSConsumer sets no-local for all TOPIC destinations Key: NIFI-7599 URL: https://issues.apache.org/jira/browse/NIFI-7599 Project: Apache NiFi Issue Type: Improvement Components: Extensions Affects Versions: 1.11.4 Reporter: Joey Frazee Assignee: Joey Frazee [createConsumer()|https://github.com/apache/nifi/blob/239a2e884c8a5c8215cf41c55122472e11dc419a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java#L58-L83] in JMSConsumer sets no-local based on whether the destination is TOPIC (pubSubDomain) or not. Setting no-local isn't supported by all brokers, nor does every TOPIC need to ignore local messages. This should be broken out into its own property or available via a dynamic property. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (NIFI-2072) Support named captures in ExtractText
[ https://issues.apache.org/jira/browse/NIFI-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17151064#comment-17151064 ] Otto Fowler commented on NIFI-2072: --- OK I have a PR just about ready for this. But just to get some feedback first: After the PR there implicitly two ways the processor works based on the enable named groups property. The old way if it is not enabled. The new way. The new way is different in that numeric indices are not added until the second set of matches ( if you have that enabled). The root attribute name is used for the 0 group -or- the whole match line if there are no groups specified. such as : {code:java} @Test public void testFindAll() throws Exception { final TestRunner testRunner = TestRunners.newTestRunner(new ExtractText()); testRunner.setProperty(ENABLE_NAMED_GROUPS, "true"); testRunner.setProperty(ExtractText.ENABLE_REPEATING_CAPTURE_GROUP, "true"); final String attributeKey = "regex.result"; testRunner.setProperty(attributeKey, "(?s)(?\\w+)"); testRunner.enqueue("This is my text".getBytes(StandardCharsets.UTF_8)); testRunner.run(); testRunner.assertAllFlowFilesTransferred(ExtractText.REL_MATCH, 1); final MockFlowFile out = testRunner.getFlowFilesForRelationship(ExtractText.REL_MATCH).get(0); // Ensure the zero capture group is in the resultant attributes out.assertAttributeExists(attributeKey); out.assertAttributeExists(attributeKey + ".W"); out.assertAttributeExists(attributeKey + ".W.1"); out.assertAttributeExists(attributeKey + ".W.2"); out.assertAttributeExists(attributeKey + ".W.3"); out.assertAttributeEquals(attributeKey, "This"); out.assertAttributeEquals(attributeKey + ".W", "This"); out.assertAttributeEquals(attributeKey + ".W.1", "is"); out.assertAttributeEquals(attributeKey + ".W.2", "my"); out.assertAttributeEquals(attributeKey + ".W.3", "text"); } @Test public void testFindAllPair() throws Exception { final TestRunner testRunner = TestRunners.newTestRunner(new ExtractText()); testRunner.setProperty(ENABLE_NAMED_GROUPS, "true"); testRunner.setProperty(ExtractText.ENABLE_REPEATING_CAPTURE_GROUP, "true"); final String attributeKey = "regex.result"; testRunner.setProperty(attributeKey, "(?\\w+)=(?\\d+)"); testRunner.enqueue("a=1,b=10,c=100".getBytes(StandardCharsets.UTF_8)); testRunner.run(); testRunner.assertAllFlowFilesTransferred(ExtractText.REL_MATCH, 1); final MockFlowFile out = testRunner.getFlowFilesForRelationship(ExtractText.REL_MATCH).get(0); // Ensure the zero capture group is in the resultant attributes out.assertAttributeExists(attributeKey); out.assertAttributeExists(attributeKey + ".LEFT"); out.assertAttributeExists(attributeKey + ".RIGHT"); out.assertAttributeExists(attributeKey + ".LEFT.1"); out.assertAttributeExists(attributeKey + ".RIGHT.1"); out.assertAttributeExists(attributeKey + ".LEFT.2"); out.assertAttributeExists(attributeKey + ".RIGHT.2"); out.assertAttributeNotExists(attributeKey + ".LEFT.3"); // Ensure there's no more attributes out.assertAttributeNotExists(attributeKey + ".RIGHT.3"); // Ensure there's no more attributes out.assertAttributeEquals(attributeKey , "a=1"); out.assertAttributeEquals(attributeKey + ".LEFT", "a"); out.assertAttributeEquals(attributeKey + ".RIGHT", "1"); out.assertAttributeEquals(attributeKey + ".LEFT.1", "b"); out.assertAttributeEquals(attributeKey + ".RIGHT.1", "10"); out.assertAttributeEquals(attributeKey + ".LEFT.2", "c"); out.assertAttributeEquals(attributeKey + ".RIGHT.2", "100"); } {code} > Support named captures in ExtractText > - > > Key: NIFI-2072 > URL: https://issues.apache.org/jira/browse/NIFI-2072 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Joey Frazee >Assignee: Otto Fowler >Priority: Major > > ExtractText currently captures and creates attributes using numeric indices > (e.g, attribute.name.0, attribute.name.1, etc.) whether or not the capture > groups are named, i.e., patterns like (?\w+). > In addition to being more faithful to the provided regexes, named captures > could help simplify data flows because you wouldn't have to add superfluous > UpdateAttribute steps which are just renaming the indexed captures to more > interpretable names. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (NIFI-2072) Support named captures in ExtractText
[ https://issues.apache.org/jira/browse/NIFI-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17151065#comment-17151065 ] Otto Fowler commented on NIFI-2072: --- [~pvillard] > Support named captures in ExtractText > - > > Key: NIFI-2072 > URL: https://issues.apache.org/jira/browse/NIFI-2072 > Project: Apache NiFi > Issue Type: Improvement >Reporter: Joey Frazee >Assignee: Otto Fowler >Priority: Major > > ExtractText currently captures and creates attributes using numeric indices > (e.g, attribute.name.0, attribute.name.1, etc.) whether or not the capture > groups are named, i.e., patterns like (?\w+). > In addition to being more faithful to the provided regexes, named captures > could help simplify data flows because you wouldn't have to add superfluous > UpdateAttribute steps which are just renaming the indexed captures to more > interpretable names. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [nifi] yegorbond commented on pull request #4065: NIFI-4239 - Adding CaptureChangePostgreSQL processor to capture data changes (INSERT/UPDATE/DELETE) in PostgreSQL tables via Logical Replicat
yegorbond commented on pull request #4065: URL: https://github.com/apache/nifi/pull/4065#issuecomment-653460003 Hello team! Do you have any plans to release this PR in the nearest time? 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org