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

[FEATURE REQUEST]: udf support for dynamic assemblies #957

Open
fwaris opened this issue Jul 21, 2021 · 4 comments
Open

[FEATURE REQUEST]: udf support for dynamic assemblies #957

fwaris opened this issue Jul 21, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@fwaris
Copy link

fwaris commented Jul 21, 2021

In a recent talk Michael Rys showed udfs being used in a notebook setting with Azure Synapse.

I was under the impression udfs worked in compiled assemblies only.

Not sure the how the notebooks are coded but when I try to define a udf in F# interactive, I get the following error:

System.NotSupportedException: The invoked member is not supported in a dynamic assembly.
   at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
   at Microsoft.Spark.Utils.UdfSerDe.SerializeType(Type type)

It would be nice if the creation of Spark udfs in most interactive environments was supported. Let us know if there any plans for this.

@fwaris fwaris added the enhancement New feature or request label Jul 21, 2021
@fwaris fwaris changed the title [FEATURE REQUEST]: udfs support for dynamic assemblies [FEATURE REQUEST]: udf support for dynamic assemblies Jul 21, 2021
@MikeRys
Copy link
Contributor

MikeRys commented Jul 21, 2021 via email

@fwaris
Copy link
Author

fwaris commented Jul 21, 2021

Michael,
Thanks for responding.

I have attached a zip file containing a README.MD with instructions and code to recreate the above issue.

I have been using Spark interactively from F# on my local machine for quite some time now. Its been working well when using plain SQL to manipulate data.

I could not define UDFs in interactive F# code because the incrementally compile F# code resides in a dynamic assembly.

However now that UDFs can be defined in notebook cells, I am hoping that we can achieve the same in F# interactive.

(Note that F# has had a REPL since 2010 and we are quite used to interactive programming in F#. Tooling support is good; intellisense and compiler checks are supported even in script files.)

sparkInteractive.zip

@MikeRys
Copy link
Contributor

MikeRys commented Jul 23, 2021 via email

@GeorgeS2019
Copy link

@fwaris
@MikeRys

Is there a solution of doing UDF in the latest of Polyglot notebook without having

Error: System.NotSupportedException: BinaryFormatter serialization and deserialization are disabled within this application. See https://aka.ms/binaryformatter for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants