public class PigRelBuilder extends RelBuilder
RelBuilder for Pig relational operators.| Modifier and Type | Class and Description |
|---|---|
static class |
PigRelBuilder.GroupOption
Option for performing group efficiently if data set is already sorted
|
(package private) static interface |
PigRelBuilder.Partitioner
Partitioner for group and join
|
RelBuilder.AggCall, RelBuilder.GroupKey, RelBuilder.GroupKeyImpl| Modifier and Type | Field and Description |
|---|---|
private String |
lastAlias |
cluster, relOptSchema| Modifier | Constructor and Description |
|---|---|
private |
PigRelBuilder(Context context,
RelOptCluster cluster,
RelOptSchema relOptSchema) |
| Modifier and Type | Method and Description |
|---|---|
RelBuilder |
as(String alias)
As super-class method, but also retains alias for naming of aggregates.
|
static PigRelBuilder |
create(FrameworkConfig config)
Creates a PigRelBuilder.
|
PigRelBuilder |
distinct(PigRelBuilder.Partitioner partitioner,
int parallel)
Removes duplicate tuples in a relation.
|
(package private) String |
getAlias() |
PigRelBuilder |
group(PigRelBuilder.GroupOption option,
PigRelBuilder.Partitioner partitioner,
int parallel,
Iterable<? extends RelBuilder.GroupKey> groupKeys) |
PigRelBuilder |
group(PigRelBuilder.GroupOption option,
PigRelBuilder.Partitioner partitioner,
int parallel,
RelBuilder.GroupKey... groupKeys)
Groups the data in one or more relations.
|
PigRelBuilder |
load(String path,
RexNode loadFunction,
RelDataType rowType)
Loads a data set.
|
PigRelBuilder |
scan(Iterable<String> tableNames)
Creates a
TableScan of the table
with a given name. |
PigRelBuilder |
scan(String... tableNames)
Creates a
TableScan of the table
with a given name. |
aggregate, aggregate, aggregate, aggregateCall, aggregateCall, aggregateCall, aggregateCall, alias, and, and, avg, build, call, call, cast, cast, cast, clear, convert, count, countStar, desc, distinct, dot, dot, empty, equals, field, field, field, field, field, field, field, fields, fields, fields, fields, fields, fields, filter, filter, getRexBuilder, getTypeFactory, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, intersect, intersect, isNotNull, isNull, join, join, join, join, join, limit, literal, match, max, min, minus, minus, not, notEquals, nullsFirst, nullsLast, or, or, patternAlter, patternAlter, patternConcat, patternConcat, patternExclude, patternField, patternPermute, patternPermute, patternQuantify, patternQuantify, peek, peek, peek, permute, project, project, project, project, proto, proto, push, pushAll, rename, semiJoin, semiJoin, sort, sort, sort, sortLimit, sortLimit, sum, union, union, values, values, values, values, variableprivate String lastAlias
private PigRelBuilder(Context context, RelOptCluster cluster, RelOptSchema relOptSchema)
public static PigRelBuilder create(FrameworkConfig config)
public PigRelBuilder scan(String... tableNames)
RelBuilderTableScan of the table
with a given name.
Throws if the table does not exist.
Returns this builder.
scan in class RelBuildertableNames - Name of table (can optionally be qualified)public PigRelBuilder scan(Iterable<String> tableNames)
RelBuilderTableScan of the table
with a given name.
Throws if the table does not exist.
Returns this builder.
scan in class RelBuildertableNames - Name of table (can optionally be qualified)public PigRelBuilder load(String path, RexNode loadFunction, RelDataType rowType)
Equivalent to Pig Latin:
LOAD 'path' USING loadFunction AS rowType
loadFunction and rowType are optional.
path - File pathloadFunction - Load functionrowType - Row type (what Pig calls 'schema')public PigRelBuilder distinct(PigRelBuilder.Partitioner partitioner, int parallel)
Equivalent Pig Latin:
alias = DISTINCT alias [PARTITION BY partitioner] [PARALLEL n];
partitioner - Partitioner; null means no partitionerparallel - Degree of parallelism; negative means unspecifiedpublic PigRelBuilder group(PigRelBuilder.GroupOption option, PigRelBuilder.Partitioner partitioner, int parallel, RelBuilder.GroupKey... groupKeys)
Pig Latin syntax:
alias = GROUP alias { ALL | BY expression } [, alias ALL | BY expression ...] [USING 'collected' | 'merge'] [PARTITION BY partitioner] [PARALLEL n];
groupKeys - One of more group keys; use RelBuilder.groupKey() for ALLoption - Whether to use an optimized method combining the data
(COLLECTED for one input or MERGE for two or more inputs)partitioner - Partitioner; null means no partitionerparallel - Degree of parallelism; negative means unspecifiedpublic PigRelBuilder group(PigRelBuilder.GroupOption option, PigRelBuilder.Partitioner partitioner, int parallel, Iterable<? extends RelBuilder.GroupKey> groupKeys)
String getAlias()
public RelBuilder as(String alias)
as in class RelBuilderCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.