Class StringFeatureBuilder
- java.lang.Object
-
- com.c12e.cortex.profiles.featurecatalog.featurebuilder.BaseFeatureBuilder
-
- com.c12e.cortex.profiles.featurecatalog.featurebuilder.StringFeatureBuilder
-
- All Implemented Interfaces:
FeatureBuilder
public class StringFeatureBuilder extends BaseFeatureBuilder
Implementation of aBaseFeatureBuilder
for handling String data types.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COUNT
static java.lang.String
DELIMITER
static java.lang.String
PREFIX
static int
TOP_N
-
Fields inherited from class com.c12e.cortex.profiles.featurecatalog.featurebuilder.BaseFeatureBuilder
DEFAULT_PROFILE_GROUP
-
-
Constructor Summary
Constructors Constructor Description StringFeatureBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDataType()
String representation of the SparkDataType
for the feature.java.lang.String
getFeatureType()
String representation of the feature type in Cortex (e.g.void
inferFromSample(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> sampleDf, java.lang.String fieldName)
ComputesFeature
attributes from the provided sample data, specificallyFeature#uniqueCount
andFeature#pctNull
.-
Methods inherited from class com.c12e.cortex.profiles.featurecatalog.featurebuilder.BaseFeatureBuilder
build, getRecordCount, setDescription, setFieldName, setMaxValue, setMeanValue, setMinValue, setNotes, setObservations, setPctDom, setPctNull, setProfileGroup, setProject, setRecordCount, setSourceName, setStdDev, setUniqueCount
-
-
-
-
Field Detail
-
TOP_N
public static final int TOP_N
- See Also:
- Constant Field Values
-
COUNT
public static final java.lang.String COUNT
- See Also:
- Constant Field Values
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
DELIMITER
public static final java.lang.String DELIMITER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDataType
public java.lang.String getDataType()
Description copied from interface:FeatureBuilder
String representation of the SparkDataType
for the feature.- Returns:
- String data type
-
getFeatureType
public java.lang.String getFeatureType()
Description copied from interface:FeatureBuilder
String representation of the feature type in Cortex (e.g. "numeric", "categorical").- Returns:
- String feature type
-
inferFromSample
public void inferFromSample(org.apache.spark.sql.Dataset<org.apache.spark.sql.Row> sampleDf, java.lang.String fieldName)
Description copied from class:BaseFeatureBuilder
ComputesFeature
attributes from the provided sample data, specificallyFeature#uniqueCount
andFeature#pctNull
.- Specified by:
inferFromSample
in interfaceFeatureBuilder
- Overrides:
inferFromSample
in classBaseFeatureBuilder
- Parameters:
sampleDf
- sample data to infer the Feature properties fromfieldName
- name of the field in the Dataset
-
-