public class Distributions
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Distributions.DistributionImpl
Create a distribution on columns.
|
Modifier and Type | Field and Description |
---|---|
static Distribution |
HASH
List bucketing strategy hash, TODO: #1505 Separate the bucket number from the Distribution.
|
static Distribution |
NONE
NONE is used to indicate that there is no distribution.
|
static Distribution |
RANGE
List bucketing strategy range, TODO: #1505 Separate the bucket number from the Distribution.
|
Modifier and Type | Method and Description |
---|---|
static Distribution |
even(int number,
Expression... expressions)
Create a distribution by evenly distributing the data across the number of buckets.
|
static Distribution |
fields(Strategy strategy,
int number,
java.lang.String[]... fieldNames)
Create a distribution on columns.
|
static Distribution |
hash(int number,
Expression... expressions)
Create a distribution by hashing the data across the number of buckets.
|
static Distribution |
of(Strategy strategy,
int number,
Expression... expressions)
Create a distribution by the given strategy.
|
public static final Distribution NONE
public static final Distribution HASH
public static final Distribution RANGE
public static Distribution even(int number, Expression... expressions)
number
- The number of bucketsexpressions
- The expressions to distribute bypublic static Distribution hash(int number, Expression... expressions)
number
- The number of bucketsexpressions
- The expressions to distribute bypublic static Distribution of(Strategy strategy, int number, Expression... expressions)
strategy
- The strategy to usenumber
- The number of bucketsexpressions
- The expressions to distribute bypublic static Distribution fields(Strategy strategy, int number, java.lang.String[]... fieldNames)
Distributions.DistributionImpl.Builder
to create.
NOTE: a, b, c are column names. SQL syntax: distribute by hash(a, b) buckets 5 fields(Strategy.HASH, 5, new String[]{"a"}, new String[]{"b"}); SQL syntax: distribute by hash(a, b, c) buckets 10 fields(Strategy.HASH, 10, new String[]{"a"}, new String[]{"b"}, new String[]{"c"}); SQL syntax: distribute by EVEN(a) buckets 128 fields(Strategy.EVEN, 128, new String[]{"a"});
strategy
- The strategy to use.number
- The number of buckets.fieldNames
- The field names to distribute by.