Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27249

Developers API for Transformers beyond UnaryTransformer

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: ML
    • Labels:

      Description

      It would be nice to have a developers' API for dataset transformations that need more than one column from a row (ie UnaryTransformer inputs one column and outputs one column) or that contain objects too expensive to initialize repeatedly in a UDF such as a database connection. 

       

      Design:

      Abstract class PartitionTransformer extends Transformer and defines the partition transformation function as Iterator[Row] => Iterator[Row]

      NB: This parallels the UnaryTransformer createTransformFunc method

       

      When developers subclass this transformer, they can provide their own schema for the output Row in which case the PartitionTransformer creates a row encoder and executes the transformation. Alternatively the developer can set output Datatype and output col name. Then the PartitionTransformer class will create a new schema, a row encoder, and execute the transformation.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              enrush Everett Rush
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 96h
                96h
                Remaining:
                Remaining Estimate - 96h
                96h
                Logged:
                Time Spent - Not Specified
                Not Specified