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.htmlModifier 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()
AggregableColumnReduction
List<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 AggregableColumnReduction
public List<String> getColumnsOutputName(String columnInputName)
AggregableColumnReduction
getColumnsOutputName
in interface AggregableColumnReduction
columnInputName
- Name of the column before reductionpublic List<ColumnMetaData> getColumnOutputMetaData(List<String> newColumnName, ColumnMetaData columnInputMeta)
AggregableColumnReduction
getColumnOutputMetaData
in interface AggregableColumnReduction
columnInputMeta
- Metadata for the column, before reducepublic Schema transform(Schema inputSchema)
ColumnOp
public void setInputSchema(Schema inputSchema)
ColumnOp
setInputSchema
in interface ColumnOp
public Schema getInputSchema()
ColumnOp
getInputSchema
in interface ColumnOp
public String outputColumnName()
ColumnOp
outputColumnName
in interface ColumnOp
public String[] outputColumnNames()
ColumnOp
outputColumnNames
in interface ColumnOp
public String[] columnNames()
ColumnOp
columnNames
in interface ColumnOp
public String columnName()
ColumnOp
columnName
in interface ColumnOp
Copyright © 2018. All rights reserved.