Class UnpivotMapsRecordBatch
java.lang.Object
org.apache.drill.exec.record.AbstractRecordBatch<T>
org.apache.drill.exec.record.AbstractUnaryRecordBatch<T>
org.apache.drill.exec.record.AbstractSingleRecordBatch<UnpivotMaps>
org.apache.drill.exec.physical.impl.unpivot.UnpivotMapsRecordBatch
- All Implemented Interfaces:
AutoCloseable
,Iterable<VectorWrapper<?>>
,CloseableRecordBatch
,RecordBatch
,VectorAccessible
Unpivot maps. Assumptions are:
1) all child vectors in a map are of same type.
2) Each map contains the same number of fields and field names are also same (types could be different).
Example input and output:
Schema of input:
"schema" : BIGINT - Schema number. For each schema change this number is incremented. "computed" : BIGINT - What time is it computed? "columns" : MAP - Column names "region_id" : VARCHAR "sales_city" : VARCHAR "cnt" : VARCHAR "statscount" : MAP "region_id" : BIGINT - statscount(region_id) - aggregation over all values of region_id in incoming batch "sales_city" : BIGINT - statscount(sales_city) "cnt" : BIGINT - statscount(cnt) "nonnullstatcount" : MAP "region_id" : BIGINT - nonnullstatcount(region_id) "sales_city" : BIGINT - nonnullstatcount(sales_city) "cnt" : BIGINT - nonnullstatcount(cnt) .... another map for next stats function ....Schema of output:
"schema" : BIGINT - Schema number. For each schema change this number is incremented. "computed" : BIGINT - What time is this computed? "column" : column name "statscount" : BIGINT "nonnullstatcount" : BIGINT .... one column for each map type ...
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.drill.exec.record.AbstractRecordBatch
AbstractRecordBatch.BatchState
Nested classes/interfaces inherited from interface org.apache.drill.exec.record.RecordBatch
RecordBatch.IterOutcome
-
Field Summary
Fields inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
incoming
Fields inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
callBack
Fields inherited from class org.apache.drill.exec.record.AbstractRecordBatch
batchStatsContext, container, context, oContext, popConfig, state, stats, unionTypeEnabled
Fields inherited from interface org.apache.drill.exec.record.RecordBatch
MAX_BATCH_ROW_COUNT
-
Constructor Summary
ConstructorDescriptionUnpivotMapsRecordBatch
(UnpivotMaps pop, RecordBatch incoming, FragmentContext context) -
Method Summary
Modifier and TypeMethodDescriptionprotected RecordBatch.IterOutcome
doWork()
void
dump()
Perform dump of this batch's state to logs.int
Get the number of records.protected boolean
Methods inherited from class org.apache.drill.exec.record.AbstractSingleRecordBatch
getFinalOutcome, getIncoming
Methods inherited from class org.apache.drill.exec.record.AbstractUnaryRecordBatch
cancelIncoming, getLastKnownOutcome, handleNullInput, setLastKnownOutcome
Methods inherited from class org.apache.drill.exec.record.AbstractRecordBatch
buildSchema, cancel, checkContinue, close, getContainer, getContext, getPopConfig, getRecordBatchStatsContext, getSchema, getSelectionVector2, getSelectionVector4, getValueAccessorById, getValueVectorId, getWritableBatch, isRecordBatchStatsLoggingEnabled, iterator, next, next, next, schemaChangeException, schemaChangeException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
UnpivotMapsRecordBatch
public UnpivotMapsRecordBatch(UnpivotMaps pop, RecordBatch incoming, FragmentContext context) throws OutOfMemoryException - Throws:
OutOfMemoryException
-
-
Method Details
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessible
Get the number of records.- Returns:
- number of records
-
innerNext
- Overrides:
innerNext
in classAbstractUnaryRecordBatch<UnpivotMaps>
-
getOutgoingContainer
- Specified by:
getOutgoingContainer
in interfaceRecordBatch
- Overrides:
getOutgoingContainer
in classAbstractRecordBatch<UnpivotMaps>
-
doWork
- Specified by:
doWork
in classAbstractUnaryRecordBatch<UnpivotMaps>
-
setupNewSchema
protected boolean setupNewSchema()- Specified by:
setupNewSchema
in classAbstractUnaryRecordBatch<UnpivotMaps>
-
dump
public void dump()Description copied from interface:RecordBatch
Perform dump of this batch's state to logs.
-