public class EncoderRecode extends Encoder
Constructor and Description |
---|
EncoderRecode() |
EncoderRecode(org.apache.wink.json4j.JSONObject parsedSpec,
String[] colnames,
int clen,
int minCol,
int maxCol) |
Modifier and Type | Method and Description |
---|---|
MatrixBlock |
apply(FrameBlock in,
MatrixBlock out)
Encode input data blockwise according to existing transform meta
data (transform apply).
|
void |
build(FrameBlock in)
Build the transform meta data for the given block input.
|
void |
buildPartial(FrameBlock in) |
static String |
constructRecodeMapEntry(String token,
Long code)
Returns the Recode map entry which consists of concatenation of code, delimiter and token.
|
MatrixBlock |
encode(FrameBlock in,
MatrixBlock out)
Block encode: build and apply (transform encode).
|
HashMap<Integer,HashMap<String,Long>> |
getCPRecodeMaps() |
HashMap<Integer,HashSet<Object>> |
getCPRecodeMapsPartial() |
FrameBlock |
getMetaData(FrameBlock meta)
Construct a frame block out of the transform meta data.
|
void |
initMetaData(FrameBlock meta)
Construct the recodemaps from the given input frame for all
columns registered for recode.
|
void |
mergeAt(Encoder other,
int row,
int col)
Merges another encoder, of a compatible type, in after a certain position.
|
int[] |
numDistinctValues() |
void |
prepareBuildPartial() |
static String[] |
splitRecodeMapEntry(String value)
Splits a Recode map entry into its token and code.
|
Encoder |
subRangeEncoder(IndexRange ixRange)
Returns a new Encoder that only handles a sub range of columns.
|
getColList, getColMapping, getNumCols, initColList, initColList, isApplicable, isApplicable, setColList, updateIndexRanges
public EncoderRecode(org.apache.wink.json4j.JSONObject parsedSpec, String[] colnames, int clen, int minCol, int maxCol) throws org.apache.wink.json4j.JSONException
org.apache.wink.json4j.JSONException
public EncoderRecode()
public MatrixBlock encode(FrameBlock in, MatrixBlock out)
Encoder
public void build(FrameBlock in)
Encoder
public void prepareBuildPartial()
public void buildPartial(FrameBlock in)
public MatrixBlock apply(FrameBlock in, MatrixBlock out)
Encoder
public Encoder subRangeEncoder(IndexRange ixRange)
Encoder
subRangeEncoder
in class Encoder
ixRange
- the range (1-based, begin inclusive, end exclusive)public void mergeAt(Encoder other, int row, int col)
Encoder
Encoders
are compatible with themselves and EncoderComposite
is compatible with every
other Encoder
.public int[] numDistinctValues()
public FrameBlock getMetaData(FrameBlock meta)
Encoder
getMetaData
in class Encoder
meta
- output frame blockpublic void initMetaData(FrameBlock meta)
initMetaData
in class Encoder
meta
- frame blockpublic static String constructRecodeMapEntry(String token, Long code)
token
- is part of Recode mapcode
- is code for tokenCopyright © 2020 The Apache Software Foundation. All rights reserved.