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

Addresses issue of assembly.zip contents not unzipped to current directory, preventing UDF failures by default. #622

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zzhu8192a
Copy link

…bly or UDF's fail with serialization errors

Code change to unzip contents of assembly.zip to current directory instead.

We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

…bly or UDF's fail with serialization errors

Code change to unzip contents of assembly.zip to current directory instead.
//val driverDir = new File(workingDir, FilenameUtils.getBaseName(zipFileUri.getPath()))
// ZZ: By unzipping into the working directory, this ensures currentdir is the dir containing the files that is needed to properly handle UDF's, without the need to set ASSEMBLY_PATHS
// The alternative here would be to change current working directory to the subdirectory path, but that seems like it could have more unintended side effects
val driverDir = workingDir
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious how extracting the zip file to the driver's current directory will allow the Microsoft.Spark.Worker to locate the udf assemblies.

Copy link
Member

Choose a reason for hiding this comment

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

Is it expected that the working directory of the driver is accessible by the Microsoft.Spark.Worker that may be running on separate nodes in the cluster ?

Copy link
Author

Choose a reason for hiding this comment

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

well, the assumption I have is that the assembly.zip bundle in question would have the assemblies containing the UDF's. That's how we're using it. And having that in the working directory empirically works, where as if the assembly is unzipped to a subdirectory from the working directory, i.e. assembly/* does not (causes serialization errors). I don't know whether that's by intention or caused by some other side effect, but this is what we've observed.

The issue is that, if the assemblies are not in the same directory in which you're launch DotnetRunner, then UDF's don't get picked up (unless it's in the ASSEMBLY_SEARCH_PATH, which we won't be able to set conveniently). But if it's unzipped to the working directory for DotnetRunner, then the SEARCH PATH won't need to be set at all.

Hope that makes sense?

Copy link
Member

Choose a reason for hiding this comment

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

AssemblyLoader.cs will set up the paths for the Worker to search for UDF assemblies. Unless the working directory of the Worker is set to the driver's working directory and is also accessible by the worker, then I don't know if this would be the proper fix. Have you been able to test this in cluster mode and/or in other big data platforms like HDInsight/Databricks ?

Copy link
Member

Choose a reason for hiding this comment

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

@zzhu-bh have you been able to test this PR in a spark cluster ?

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the follow up @suhsteve! Sorry, we have not been able to work on this, our teams have been putting out some fires. I'll see if I can get someone on the team to follow up on this issue. Thank you for your patience.

Base automatically changed from master to main March 18, 2021 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants