-
Couldn't load subscription status.
- Fork 315
Extract SparkPlan product and append to trace #9783
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
Merged
charlesmyu
merged 26 commits into
master
from
charles.yu/djm-974/extract-spark-plan-product
Oct 28, 2025
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
be7ada4
Extract Spark Plan product with keys for Scala 2.13
charlesmyu 9c19e11
Extract Spark Plan product values for Spark 2.12
charlesmyu 3f9c26b
Update tests for meta field in Spark SQL plans
charlesmyu 94f3139
Remove unused logic to parse children, enrich product parsing to supp…
charlesmyu beb4d5f
Update tests to assert on meta values
charlesmyu 750c68f
Use Abstract class for common functions
charlesmyu 0279fff
Use Jackson JSON parser instead of rolling own parsing
charlesmyu 50fa41a
Refactor AbstractSparkPlanUtils to only require key generation on impl
charlesmyu 51835fa
Default to returning null if class not recognized, limit recursion de…
charlesmyu c68b356
Improve testing scheme for Spark32 on Scala 212 with unknown keys
charlesmyu 8bf8488
Improve method & class naming, reuse ObjectMapper from listener
charlesmyu 55b917b
Gate Spark Plan parsing with flag
charlesmyu 047880a
Match classes by string comparison, add negative cache
charlesmyu 3619b77
Add unit tests for AbstractSparkPlanSerializer
charlesmyu 53918a3
Make ObjectMapper protected on AbstractDatadogSparkListener instead o…
charlesmyu 6e68c69
Specify correct helper class names
charlesmyu 5483ba8
Add dd.data.jobs.experimental_features.enabled FF
charlesmyu e4973fc
Remove knownMatchingTypes override from version-specific impls
charlesmyu 5527ad0
Catch NullPointerException for getDeclaredMethod calls
charlesmyu 1f31add
Adjust more gates to match classes using string comparison
charlesmyu 18e51d5
Revert "Catch NullPointerException for getDeclaredMethod calls"
charlesmyu de336b9
Explicit cast to String on simpleString calls
charlesmyu 160558e
Use toMap to convert mutable to immutable map in Scala 2.12
charlesmyu d4c8264
Improvements from comments: use singleton, string concat instead of f…
charlesmyu ef18062
Avoid merge conflict, reorder flags
charlesmyu 34528dc
Exit loop early, store reflected methods as class fields
charlesmyu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../spark_2.12/src/main/java/datadog/trace/instrumentation/spark/Spark212PlanSerializer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package datadog.trace.instrumentation.spark; | ||
|
|
||
| import org.apache.spark.sql.catalyst.trees.TreeNode; | ||
|
|
||
| public class Spark212PlanSerializer extends AbstractSparkPlanSerializer { | ||
| @Override | ||
| public String getKey(int idx, TreeNode node) { | ||
| return "_dd.unknown_key." + idx; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../spark_2.13/src/main/java/datadog/trace/instrumentation/spark/Spark213PlanSerializer.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package datadog.trace.instrumentation.spark; | ||
|
|
||
| import org.apache.spark.sql.catalyst.trees.TreeNode; | ||
|
|
||
| public class Spark213PlanSerializer extends AbstractSparkPlanSerializer { | ||
| @Override | ||
| public String getKey(int idx, TreeNode node) { | ||
| return node.productElementName(idx); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.