public class GeographicMidpointReduction extends Object implements AggregableColumnReduction
Text writables with format "lat,long" (the
delimiter is configurable), determine the geographic midpoint.
See "geographic midpoint" at: http://www.geomidpoint.com/methods.html
For implementation algorithm, see: http://www.geomidpoint.com/calculation.html| Modifier and Type | Class and Description |
|---|---|
static class |
GeographicMidpointReduction.AverageCoordinateReduceOp |
| Modifier and Type | Field and Description |
|---|---|
static double |
EDGE_CASE_EPS |
| Constructor and Description |
|---|
GeographicMidpointReduction(String delim) |
GeographicMidpointReduction(String delim,
String newColumnName) |
| Modifier and Type | Method and Description |
|---|---|
String |
columnName()
Returns a singular column name
this op is meant to run on
|
String[] |
columnNames()
Returns column names
this op is meant to run on
|
List<ColumnMetaData> |
getColumnOutputMetaData(List<String> newColumnName,
ColumnMetaData columnInputMeta)
Post-reduce: what is the metadata (type, etc) for this column?
For example: a "count unique" operation on a String (StringMetaData) column would return an Integer (IntegerMetaData) column
|
List<String> |
getColumnsOutputName(String columnInputName)
Post-reduce: what is the name of the column?
For example, "myColumn" -> "mean(myColumn)"
|
Schema |
getInputSchema()
Getter for input schema
|
String |
outputColumnName()
The output column name
after the operation has been applied
|
String[] |
outputColumnNames()
The output column names
This will often be the same as the input
|
IAggregableReduceOp<Writable,List<Writable>> |
reduceOp()
Reduce a single column.
|
void |
setInputSchema(Schema inputSchema)
Set the input schema.
|
Schema |
transform(Schema inputSchema)
Get the output schema for this transformation, given an input schema
|
public static final double EDGE_CASE_EPS
public GeographicMidpointReduction(String delim)
delim - Delimiter for the coordinates in text format. For example, if format is "lat,long" use ","public IAggregableReduceOp<Writable,List<Writable>> reduceOp()
AggregableColumnReductionList<Writable>
here is a single column in a reduction window,
and NOT the single row
(as is usually the case for List<Writable> instancesreduceOp in interface AggregableColumnReductionpublic List<String> getColumnsOutputName(String columnInputName)
AggregableColumnReductiongetColumnsOutputName in interface AggregableColumnReductioncolumnInputName - Name of the column before reductionpublic List<ColumnMetaData> getColumnOutputMetaData(List<String> newColumnName, ColumnMetaData columnInputMeta)
AggregableColumnReductiongetColumnOutputMetaData in interface AggregableColumnReductioncolumnInputMeta - Metadata for the column, before reducepublic Schema transform(Schema inputSchema)
ColumnOppublic void setInputSchema(Schema inputSchema)
ColumnOpsetInputSchema in interface ColumnOppublic Schema getInputSchema()
ColumnOpgetInputSchema in interface ColumnOppublic String outputColumnName()
ColumnOpoutputColumnName in interface ColumnOppublic String[] outputColumnNames()
ColumnOpoutputColumnNames in interface ColumnOppublic String[] columnNames()
ColumnOpcolumnNames in interface ColumnOppublic String columnName()
ColumnOpcolumnName in interface ColumnOpCopyright © 2019. All rights reserved.