Specify the execution locus for UDFs

Starting in release 6.0, there are two new views that you can use to control the execution locus and behavior of a UDX:
  • The _v_dual_dslice view returns one row for each dataslice, which causes the UDX to be evaluated on all SPUs.
  • The _v_dual view returns one row and causes the UDX to be evaluated on the host.

In previous releases, it was a common practice for users to create a single-row table or a multi-row table to control whether a UDX would be evaluated on one or all SPUs. You can use these views with a UDTF as well, but the behavior of the UDTF is also controlled by the execution locus options that are specified with the parallel or parallel-not-allowed syntax. That is, a parallel-allowed UDTF usually runs on a SPU even if invoked with _v_dual, and a parallel-not-allowed UDTF runs on the host even if invoked with _v_dual_dslice. The _v_dual_dslice view can be useful for a parallel UDTF so that it has at least one row on each dataslice.