Home > User Defined Functions > Java
| Property | Requirement | Type | Default | Description |
|---|---|---|---|---|
| Java UDF script | ✓ | Code (java) | See template below | Input your code here |
| Worker count | ✓ | Integer | 1 | Specify how many parallel workers to launch |
| Retain input columns | ✓ | Boolean | true | Keep the original input columns? |
| Extra output column(s) | List | - | Name of the newly added output columns that the UDF will produce, if any | |
| ↳ Attribute Name | ✓ | String | - | |
| ↳ Attribute Type | ✓ | string, integer, long, double, boolean, timestamp, binary, large_binary | - |
Java UDF script
import org.apache.texera.amber.operator.map.MapOpExec; import org.apache.texera.amber.core.tuple.Tuple; import org.apache.texera.amber.core.tuple.TupleLike; import scala.Function1; import java.io.Serializable; public class JavaUDFOpExec extends MapOpExec { public JavaUDFOpExec () { this.setMapFunc((Function1<Tuple, TupleLike> & Serializable) this::processTuple); } public TupleLike processTuple(Tuple tuple) { return tuple; } }
| Port | Mode |
|---|---|
| 0 | Set Snapshot |