Are the Spark.NET 3.5.1 works in Polyglot notebook for UDF examples? #1179
Replies: 7 comments 17 replies
-
@GeorgeS2019 It does not. It tries to get entire declaring type, which is anonymous assembly that only exists within interactive session context. Code expects declaring assembly for UDF to be accessible: Notebooks without UDFs and broadcasts work fine. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I’ve made some progress in understanding the interaction, though it’s still not entirely clear. Here’s what I’ve gathered so far: Dotnet.Spark contains a separate solution for this already, The only problem i faced is that it doesn't work, it relies on Dotnet.Interactive API Thanks @GeorgeS2019 for creating issue in interactive, let's wait and see if they can point us with this exception. |
Beta Was this translation helpful? Give feedback.
-
The constructor is private. But also this class will likely be made internal as part of API stabilization. The .NET Interactive API shouldn't really be responsible for providing this kind of utility code to consumers. I'd recommend cloning the functionality as needed. |
Beta Was this translation helpful? Give feedback.
-
Hello @jonsequitur, I've investigated it in more detail, and have a few findings and questions. 1. DisposableDirectoryThe DisposableDirectory issue is resolved by using kernel.RegisterForDisposal for manual directory cleanup, which aligns with the current API. 2. Collection of referenced nugets and their dependenciesFor NuGet dependency collection, ISupportNuget has been removed, breaking the previous method of getting ResolvedPackageReferences (SupportNugetWrapper, that is utilized in PackageResolver). Workaround: I am now subscribing to the PackageAdded event to collect ResolvedPackageReference objects, which we need for probing paths and package metadata. 3. The middleware pipeline behavior for submissions appears to have changed, there's a timing issueIn AssemblyExtension there's a middleware registration, that first propagates down the pipeline I'm not sure how it worked before, but now it does not - by the time we can access dll, submission have already failed as there was no dll. If we add the DLL before If I first attach dll, and then propagate the pipeline - ScriptContext contains Question: What is the correct pattern to inject logic after compilation but before execution to prepare the Spark Context with the current submission's assembly? |
Beta Was this translation helpful? Give feedback.
-
You can see the loaded metadata references like this: |
Beta Was this translation helpful? Give feedback.
-
I would need more context here. Do you have a stack trace? Is the DLL that's missing the one that's supposed to be emitted from the I'm not sure where the timing issue could be introduced. There's no parallelism in the scheduler.
This code looks reasonable. Another approach that you could try would be to subscribe to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
#1199

@grazy27
4. User-Defined Functions
Previously in older version, it is not possible to work in the UDF notebook. Not sure if the latest 3.5.1 overcomes this limitation
https://github.com/Apress/introducing-.net-for-apache-spark

Beta Was this translation helpful? Give feedback.
All reactions