Package org.apache.calcite.tools
Class PigRelBuilder
java.lang.Object
org.apache.calcite.tools.RelBuilder
org.apache.calcite.tools.PigRelBuilder
Extension to 
RelBuilder for Pig relational operators.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumOption for performing group efficiently if data set is already sorted.Nested classes/interfaces inherited from class org.apache.calcite.tools.RelBuilderRelBuilder.AggCall, RelBuilder.Config, RelBuilder.GroupKey, RelBuilder.OverCall
- 
Field SummaryFields inherited from class org.apache.calcite.tools.RelBuildercluster, relOptSchema
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPigRelBuilder(Context context, RelOptCluster cluster, @Nullable RelOptSchema relOptSchema) 
- 
Method SummaryModifier and TypeMethodDescriptionAs super-class method, but also retains alias for naming of aggregates.static PigRelBuildercreate(FrameworkConfig config) Creates a PigRelBuilder.distinct(@Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel) Removes duplicate tuples in a relation.@Nullable StringgetAlias()group(PigRelBuilder.GroupOption option, @Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel, Iterable<? extends RelBuilder.GroupKey> groupKeys) group(PigRelBuilder.GroupOption option, @Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel, RelBuilder.GroupKey... groupKeys) Groups the data in one or more relations.load(String path, RexNode loadFunction, RelDataType rowType) Loads a data set.Creates aTableScanof the table with a given name.Creates aTableScanof the table with a given name.protected voidvalidateGroupList(List<RelBuilder.GroupKey> groupKeyList) Methods inherited from class org.apache.calcite.tools.RelBuilderadoptConvention, aggregate, aggregate, aggregate, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateCall, aggregateRex, aggregateRex, alias, all, and, and, antiJoin, antiJoin, arrayQuery, asofJoin, avg, avg, avg, avg, between, build, call, call, cast, cast, cast, 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, 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, literalAgg, literalAgg, 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, project, projectExcept, projectExcept, projectNamed, projectNamed, projectPlus, projectPlus, proto, proto, push, pushAll, rename, repeatUnion, repeatUnion, sample, scalarQuery, semiJoin, semiJoin, size, snapshot, some, sort, sort, sort, sort, sortExchange, sortLimit, sortLimit, sortLimit, sum, sum, sum, sum, toString, transform, transientScan, transientScan, unboundedFollowing, unboundedPreceding, uncollect, union, union, unique, unpivot, values, values, values, values, variable, variable, with, withPredicates, withSimplifier
- 
Constructor Details- 
PigRelBuilderprotected PigRelBuilder(Context context, RelOptCluster cluster, @Nullable RelOptSchema relOptSchema) 
 
- 
- 
Method Details- 
createCreates a PigRelBuilder.
- 
scanDescription copied from class:RelBuilderCreates aTableScanof the table with a given name.Throws if the table does not exist. Returns this builder. - Overrides:
- scanin class- RelBuilder
- Parameters:
- tableNames- Name of table (can optionally be qualified)
 
- 
scanDescription copied from class:RelBuilderCreates aTableScanof the table with a given name.Throws if the table does not exist. Returns this builder. - Overrides:
- scanin class- RelBuilder
- Parameters:
- tableNames- Name of table (can optionally be qualified)
 
- 
loadLoads a data set.Equivalent to Pig Latin: LOAD 'path' USING loadFunction AS rowTypeloadFunctionandrowTypeare optional.- Parameters:
- path- File path
- loadFunction- Load function
- rowType- Row type (what Pig calls 'schema')
- Returns:
- This builder
 
- 
distinctpublic PigRelBuilder distinct(@Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel) Removes duplicate tuples in a relation.Equivalent Pig Latin: alias = DISTINCT alias [PARTITION BY partitioner] [PARALLEL n]; - Parameters:
- partitioner- Partitioner; null means no partitioner
- parallel- Degree of parallelism; negative means unspecified
- Returns:
- This builder
 
- 
grouppublic PigRelBuilder group(PigRelBuilder.GroupOption option, @Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel, RelBuilder.GroupKey... groupKeys) Groups the data in one or more relations.Pig Latin syntax: alias = GROUP alias { ALL | BY expression } [, alias ALL | BY expression ...] [USING 'collected' | 'merge'] [PARTITION BY partitioner] [PARALLEL n]; - Parameters:
- option- 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 partitioner
- parallel- Degree of parallelism; negative means unspecified
- groupKeys- One of more group keys; use- RelBuilder.groupKey()for ALL
- Returns:
- This builder
 
- 
grouppublic PigRelBuilder group(PigRelBuilder.GroupOption option, @Nullable org.apache.calcite.tools.PigRelBuilder.Partitioner partitioner, int parallel, Iterable<? extends RelBuilder.GroupKey> groupKeys) 
- 
validateGroupList
- 
getAlias
- 
asAs super-class method, but also retains alias for naming of aggregates.- Overrides:
- asin class- RelBuilder
 
 
-