sample#

swordfish.function.sample()#

Must be used in a where clause. Take a random sample of a number of partitions in a partitioned table.

Suppose the database has N partitions. If 0<size<1, then take int(N*size) partitions. If size is a positive integer, then take size partitions.

Parameters:
  • partitionCol (Constant) – A partitioning column.

  • size (Constant) – A positive floating number or integer.