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

Fix NPE in GpuParseUrl for null keys. #10811

Merged
merged 2 commits into from
May 16, 2024

Conversation

mythrocks
Copy link
Collaborator

@mythrocks mythrocks commented May 13, 2024

Fixes #10810.

This commit fixes an NPE that occurred when ParseUrl is called to extract a specific key from the QUERY portion of the URL, and the specified key is null.

The NPE would manifest as follows:

24/05/13 14:28:35.379 Executor task launch worker for task 1.0 in stage 746.0 (TID 1493) ERROR Executor: Exception in task 1.0 in stage 746.0 (TID 1493)
java.lang.NullPointerException: null
	at org.apache.spark.sql.rapids.GpuParseUrl.doColumnar(GpuParseUrl.scala:86) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$5(GpuParseUrl.scala:123) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$4(GpuParseUrl.scala:120) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$3(GpuParseUrl.scala:119) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
...

@mythrocks mythrocks changed the title Fix NPE in GpuParseUrl for null keys: Fix NPE in GpuParseUrl for null keys. May 13, 2024
Fixes NVIDIA#10810.

This commit fixes an NPE that occurred when `ParseUrl` is called to
extract a specific key from the `QUERY` portion of the URL, and the
specified key is `null`.

The NPE would manifest as follows:
```
24/05/13 14:28:35.379 Executor task launch worker for task 1.0 in stage 746.0 (TID 1493) ERROR Executor: Exception in task 1.0 in stage 746.0 (TID 1493)
java.lang.NullPointerException: null
	at org.apache.spark.sql.rapids.GpuParseUrl.doColumnar(GpuParseUrl.scala:86) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$5(GpuParseUrl.scala:123) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$4(GpuParseUrl.scala:120) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at org.apache.spark.sql.rapids.GpuParseUrl.$anonfun$columnarEval$3(GpuParseUrl.scala:119) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
	at com.nvidia.spark.rapids.Arm$.withResourceIfAllowed(Arm.scala:84) ~[rapids-4-spark-aggregator_2.12-24.06.0-SNAPSHOT-spark330.jar:?]
...
```

Signed-off-by: MithunR <mythrocks@gmail.com>
@mythrocks
Copy link
Collaborator Author

Build

thirtiseven
thirtiseven previously approved these changes May 14, 2024
Copy link
Collaborator

@thirtiseven thirtiseven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this

revans2
revans2 previously approved these changes May 14, 2024
Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit

Signed-off-by: MithunR <mythrocks@gmail.com>
@mythrocks mythrocks dismissed stale reviews from revans2 and thirtiseven via 0ee42c9 May 14, 2024 17:48
@razajafri
Copy link
Collaborator

build

@sameerz sameerz added the bug Something isn't working label May 14, 2024
@mythrocks mythrocks requested a review from revans2 May 15, 2024 21:47
@razajafri razajafri merged commit b88d19f into NVIDIA:branch-24.06 May 16, 2024
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] NPE when running ParseUrl tests in RapidsStringExpressionsSuite
5 participants