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.
|
RelBuilder.AggCall, RelBuilder.Config, RelBuilder.GroupKey, RelBuilder.OverCallcluster, relOptSchema| Modifier | Constructor and Description |
|---|---|
protected |
PigRelBuilder(Context context,
RelOptCluster cluster,
@Nullable 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(org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner,
int parallel)
Removes duplicate tuples in a relation.
|
@Nullable String |
getAlias() |
PigRelBuilder |
group(PigRelBuilder.GroupOption option,
org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner,
int parallel,
Iterable<? extends RelBuilder.GroupKey> groupKeys) |
PigRelBuilder |
group(PigRelBuilder.GroupOption option,
org.apache.calcite.tools.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. |
protected void |
validateGroupList(List<RelBuilder.GroupKey> groupKeyList) |
adoptConvention, aggregate, aggregate, aggregate, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, alias, all, and, and, antiJoin, antiJoin, arrayQuery, avg, avg, between, build, call, call, cast, cast, cast, clear, convert, correlate, correlate, count, count, count, count, countStar, currentRow, cursor, desc, distinct, dot, dot, empty, equals, exchange, exists, field, field, field, field, field, field, field, fields, fields, fields, fields, fields, fields, fields, filter, filter, filter, filter, following, functionScan, functionScan, getCluster, getRelOptSchema, getRexBuilder, getScanFactory, getTypeFactory, greaterThan, greaterThanOrEqual, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, groupKey, hints, hints, in, in, in, in, intersect, intersect, isDistinctFrom, isNotDistinctFrom, isNotNull, isNull, join, join, join, join, join, lessThan, lessThanOrEqual, let, limit, literal, mapQuery, match, max, max, min, min, minus, minus, multisetQuery, not, notEquals, nullsFirst, nullsLast, or, or, patternAlter, patternAlter, patternConcat, patternConcat, patternExclude, patternField, patternPermute, patternPermute, patternQuantify, patternQuantify, peek, peek, peek, permute, pivot, preceding, project, project, project, project, projectExcept, projectExcept, projectNamed, projectPlus, projectPlus, proto, proto, push, pushAll, rename, repeatUnion, repeatUnion, scalarQuery, semiJoin, semiJoin, size, snapshot, some, sort, sort, sort, sort, sortExchange, sortLimit, sortLimit, sortLimit, sum, sum, toString, transform, transientScan, transientScan, unboundedFollowing, unboundedPreceding, uncollect, union, union, unique, unpivot, values, values, values, values, variable, with, withPredicates, withSimplifierprotected PigRelBuilder(Context context, RelOptCluster cluster, @Nullable 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(org.apache.calcite.tools.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, org.apache.calcite.tools.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, org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel, Iterable<? extends RelBuilder.GroupKey> groupKeys)
protected void validateGroupList(List<RelBuilder.GroupKey> groupKeyList)
public @Nullable String getAlias()
public RelBuilder as(String alias)
as in class RelBuilderCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.