-
Notifications
You must be signed in to change notification settings - Fork 234
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 FileAlreadyExistsException in LORE dump process #11484
Fix FileAlreadyExistsException in LORE dump process #11484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @ustcfy We also need to add a check that the root dir of lore dump should be empty.
@@ -197,6 +197,17 @@ object GpuLore { | |||
s"when ${RapidsConf.LORE_DUMP_IDS.key} is set.")) | |||
|
|||
val spark = SparkShimImpl.sessionFromPlan(sparkPlan) | |||
|
|||
Option(spark.sparkContext.getLocalProperty(SQLExecution.EXECUTION_ID_KEY)).foreach { executionId => | |||
if (!idGen.containsKey(executionId)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit tricky to me. How about maintaining a hashmap for this check?
Please add test for this change, and update dev/lore.md doc. |
sql-plugin/src/main/scala/com/nvidia/spark/rapids/lore/GpuLore.scala
Outdated
Show resolved
Hide resolved
build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
build |
2 similar comments
build |
build |
build |
2 similar comments
build |
build |
Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
…checks. Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
Signed-off-by: ustcfy <[email protected]>
Co-authored-by: Renjie Liu <[email protected]>
Signed-off-by: ustcfy <[email protected]>
8366259
to
13784e9
Compare
build |
2 similar comments
build |
build |
@@ -90,7 +90,7 @@ object GpuLore { | |||
|
|||
def dumpObject[T: ClassTag](obj: T, path: Path, hadoopConf: Configuration): Unit = { | |||
withResource(path.getFileSystem(hadoopConf)) { fs => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR, but typically we want to leave the underlying FileSystem.get calls memoized to make the subsequent ones cheaper. Thus the FileSystem object should not be closed via withResource
executionId => | ||
loreOutputRootPathChecked.computeIfAbsent(executionId, _ => { | ||
val path = new Path(loreOutputRootPath) | ||
withResource(path.getFileSystem(spark.sparkContext.hadoopConfiguration)) { fs => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't withResource getFileSystem
Signed-off-by: ustcfy <[email protected]>
Co-authored-by: Gera Shegalov <[email protected]>
build |
Summary
This PR resolves the
FileAlreadyExistsException
that occurs when usingspark.rapids.sql.lore.idsToDump
to dump particular partitions.Changes Made
IllegalArgumentException
is thrown to prevent overwriting existing data.