java.lang.Object
com.pervasive.datarush.operators.AbstractLogicalOperator
com.pervasive.datarush.operators.CompositeOperator
com.pervasive.datarush.operators.record.DiscoverDomain
- All Implemented Interfaces:
LogicalOperator
Utility operator for discovering the domain of string fields.
Note that this is not intended to be used as a "top-level" operator; rather this
is a utility for iterative operators that wish to compute their domains
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompose the body of this operator.Returns a list of fields to include in the discovery.getInput()Returns the input port containing the string fields to convertintReturns the maximum number of values to discover.Returns the discovered resultvoidsetIncludedFields(List<String> includedFields) Sets a list of fields to include in the discovery.voidsetMaxDiscoveredValues(int maxDiscoveredValues) Sets the maximum number of values to discover.Methods inherited from class com.pervasive.datarush.operators.AbstractLogicalOperator
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
-
Constructor Details
-
DiscoverDomain
public DiscoverDomain()
-
-
Method Details
-
getInput
Returns the input port containing the string fields to convert- Returns:
- the input port containing the string fields to convert
-
getIncludedFields
Returns a list of fields to include in the discovery. The default value of "empty" implies that we include all fields.- Returns:
- a list of fields to include
-
setIncludedFields
Sets a list of fields to include in the discovery. The default value of "empty" implies that we include all fields.- Parameters:
includedFields- a list of fields to include
-
getMaxDiscoveredValues
public int getMaxDiscoveredValues()Returns the maximum number of values to discover. This places a cap on the memory usage in the event that the input data contains a large number of distinct values. Fields that exceed the number of discovered values will remain as strings. This is 1000 by default.- Returns:
- the maximum number of values to discover
-
setMaxDiscoveredValues
public void setMaxDiscoveredValues(int maxDiscoveredValues) Sets the maximum number of values to discover. This places a cap on the memory usage in the event that the input data contains a large number of distinct values. Fields that exceed the number of discovered values will remain as strings. This is 1000 by default.- Parameters:
maxDiscoveredValues- the maximum number of values to discover
-
getResult
Returns the discovered result- Returns:
-
compose
Description copied from class:CompositeOperatorCompose the body of this operator. Implementations should do the following:- Perform any validation of configuration, input types, etc
- Instantiate and configure sub-operators, adding them to the provided context via
the method
OperatorComposable.add(O) - Create necessary connections via the method
OperatorComposable.connect(P, P). This includes connections from the composite's input ports to sub-operators, connections between sub-operators, and connections from sub-operators output ports to the composite's output ports
- Specified by:
composein classCompositeOperator- Parameters:
ctx- the context
-