Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualification tool: Catch exception for invalid regex patterns #3964

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

nartal1
Copy link
Collaborator

@nartal1 nartal1 commented Oct 28, 2021

This is a small PR to catch exception when invalid regex pattern is provided while filtering by application name.
Earlier we used to get exception for this command:

$ java -cp /home/spark-rapids/jars/rapids-4-spark-tools_2.12-21.12.0-SNAPSHOT.jar:/home/spark/spark-3.1.1-bin-hadoop3.2/jars/* com.nvidia.spark.rapids.tool.qualification.QualificationMain  -a *spark /home/spark-eventlog/spark-eventlog-3.x

Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*spark
^
        at java.util.regex.Pattern.error(Pattern.java:1969)
        at java.util.regex.Pattern.sequence(Pattern.java:2137)
        at java.util.regex.Pattern.expr(Pattern.java:2010)
        at java.util.regex.Pattern.compile(Pattern.java:1702)
        at java.util.regex.Pattern.<init>(Pattern.java:1352)
        at java.util.regex.Pattern.compile(Pattern.java:1028)

This PR prints message and exits.

21/10/28 15:56:57 ERROR AppFilterImpl:  *spark is not a valid regex pattern. Please provide correct regex pattern.

Signed-off-by: Niranjan Artal <nartal@nvidia.com>
@nartal1 nartal1 added the tools label Oct 28, 2021
@nartal1 nartal1 added this to the Oct 18 - Oct 29 milestone Oct 28, 2021
@nartal1 nartal1 self-assigned this Oct 28, 2021
@nartal1
Copy link
Collaborator Author

nartal1 commented Oct 28, 2021

build

Signed-off-by: Niranjan Artal <nartal@nvidia.com>
@tgravescs
Copy link
Collaborator

build

@nartal1 nartal1 merged commit 40f56cf into NVIDIA:branch-21.12 Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants