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 ReadSchema in Qualification tool and NPE in Profiling tool #825

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions core/src/main/scala/org/apache/spark/sql/rapids/tool/AppBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,20 @@ abstract class AppBase(
// Get ReadSchema of each Node and sanitize it for comparison
val trimmedNode = trimSchema(ReadParser.parseReadNode(node).schema)
readSchema.contains(trimmedNode)
}).filter(ReadParser.isScanNode(_)).head
}).filter(ReadParser.isScanNode(_))

dataSourceInfo += DataSourceCase(sqlID,
scanNode.id,
meta.getOrElse("Format", "unknown"),
meta.getOrElse("Location", "unknown"),
meta.getOrElse("PushedFilters", "unknown"),
readSchema
)
// If the ReadSchema is empty or if it is PhotonScan, then we don't need to
// add it to the dataSourceInfo
nartal1 marked this conversation as resolved.
Show resolved Hide resolved
// Processing Photon eventlogs issue: https://github.com/NVIDIA/spark-rapids-tools/issues/251
if (scanNode.nonEmpty) {
dataSourceInfo += DataSourceCase(sqlID,
scanNode.head.id,
meta.getOrElse("Format", "unknown"),
meta.getOrElse("Location", "unknown"),
meta.getOrElse("PushedFilters", "unknown"),
readSchema
)
}
}
// "scan hive" has no "ReadSchema" defined. So, we need to look explicitly for nodes
// that are scan hive and add them one by one to the dataSource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ class ApplicationInfo(
nodeIds.contains((j.sqlID.get, n.id))
}
validNodes.map(n => s"${n.name}(${n.id.toString})")
}.getOrElse(null)
}.getOrElse(Seq.empty)
SQLStageInfoProfileResult(index, j.sqlID.get, jobId, s, sa, info.duration, nodeNames)
}
}
Expand Down
Loading