Skip to content

[Feature][spark-transform-code] Transform via user define code #1901

Open
@smokeriu

Description

@smokeriu

Search before asking

  • I had searched in the feature and found no similar feature requirement.

Description

Allow users to upload a custom Java Code file . and call it like a UDF.

Usage Scenario

  • User use --files to upload their code.java.
  • Define a class named CodeInvokeExpress in package org.apache.spark.sql.expression.
    • Because I need use some private method/class.
  • Use CodeGenerator to compile user code.java.
    • A similar CodeGenerator is already implemented by Spark via Janino, so we don't need to add additional dependencies.
    • I plan to use, for the time being, the CodeGenerator that Spark has implemented . It has been fully tested.
  • Use Expression.eval to invoke compile result.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions