edu.udo.cs.miningmart.operator
Class UnionByKey

java.lang.Object
  extended byedu.udo.cs.miningmart.operator.ExecutableOperator
      extended byedu.udo.cs.miningmart.operator.ConceptOperator
          extended byedu.udo.cs.miningmart.operator.SingleCSOperator
              extended byedu.udo.cs.miningmart.operator.UnionByKey

public class UnionByKey
extends SingleCSOperator

UnionByKey operator takes as an input concepts and selected features from these conpcepts. Then it creates the output concept containing the data found in all the input concepts by joining concepts' columnsets according to the specified key attributes. It is useful in a situation that we would like to gather the data not only for the common to all the input concepts subset of keys, as it is in case of JoinByKey operator. The columnset generated for the output concept is of type table!

Version:
$Id: UnionByKey.java,v 1.6 2006/04/11 14:10:11 euler Exp $
Author:
Timm Euler, Martin Scholz

Field Summary
 
Fields inherited from class edu.udo.cs.miningmart.operator.ExecutableOperator
generatedSQLDefinitions
 
Constructor Summary
UnionByKey()
           
 
Method Summary
protected  java.lang.String generateColumns(Columnset csForOutputConcept)
          Overrides the superclass method because the mapping is used.
 java.lang.String generateSQLDefinition(java.lang.String selectPart)
          SQL definition of the table created for the output concept is simply the name of this table.
protected  Feature[][] getInOutMap()
          Getter method for the mapping parameters.
 Concept getInputConcept()
          TheInputConcept now is the first concept of the loaded list.
 BaseAttribute getOutputIdAttribute()
          Tries to find the key of the output concept.
 Concept[] getTheConcepts()
           
 BaseAttribute[] getTheKeys()
           
 java.lang.String getTypeOfNewColumnSet()
          Always returns 'T' as the new columnset is a table
 void load(Step st)
          Loads all parameters for this operator.
protected  boolean mustCopyFeature(java.lang.String nameOfFeature)
          It is never called.
 
Methods inherited from class edu.udo.cs.miningmart.operator.SingleCSOperator
generateColumnSetsForOp, generateSQLDefinition, getNewCSName, getTypeOfNewColumnSet
 
Methods inherited from class edu.udo.cs.miningmart.operator.ConceptOperator
compileStatement, createMetadata, createMetadataForOneBA, createSingleColumnSet, createStatement, estimateStatistics, getNewCSName, getOutputConcept, getStringForSelection, setNewCSMultiStepBranch
 
Methods inherited from class edu.udo.cs.miningmart.operator.ExecutableOperator
autoPrint, checkConditions, doPrint, doPrint, execute, executeBusinessSingleValueSqlRead, executeBusinessSingleValueSqlReadL, executeBusinessSqlRead, executeBusinessSqlWrite, executeM4SingleValueSqlRead, executeM4SingleValueSqlReadL, executeM4SqlRead, executeM4SqlWrite, getArtificalColumnName, getBusinessDbms, getHighestLoopNr, getM4Db, getM4Dbms, getM4ObjectFromCache, getName, getNextM4SequenceValue, getNumberOfLoops, getOperator, getOpParamsIterator, getParameter, getParameter, getSingleParameter, getSingleParameter, getStep, handleAssertions, isDeselectedParameter, isLoopable, isManual, isStepable, print, putM4ObjectToCache, showCreateStatement, storedProceduresAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnionByKey

public UnionByKey()
Method Detail

getTheConcepts

public Concept[] getTheConcepts()
                         throws M4CompilerError
Returns:
parameter array "TheConcepts"
Throws:
M4CompilerError

getTheKeys

public BaseAttribute[] getTheKeys()
                           throws M4CompilerError
Returns:
parameter array "TheKeys"
Throws:
M4CompilerError

getInOutMap

protected Feature[][] getInOutMap()
                           throws M4CompilerError
Getter method for the mapping parameters.

Returns:
A two-dimensional array of Features. At position [0][i] is the ith "MapInput", at position [1][i] is the ith "MapOutput".
Throws:
M4CompilerError

getOutputIdAttribute

public BaseAttribute getOutputIdAttribute()
                                   throws M4CompilerError
Tries to find the key of the output concept. Therefore it uses the defined mappings (parameter of the operator) and looks for corresponding attributes (by name) of the keys of the input concepts.

Returns:
the key of the output concept
Throws:
M4CompilerError - if no key can be identified

load

public void load(Step st)
          throws ParameterDeselectedError,
                 M4CompilerError
Description copied from class: ExecutableOperator
Loads all parameters for this operator.

Overrides:
load in class ExecutableOperator
Parameters:
st - This executable operator's step
Throws:
ParameterDeselectedError
M4CompilerError

getInputConcept

public Concept getInputConcept()
                        throws M4CompilerError
TheInputConcept now is the first concept of the loaded list.

Overrides:
getInputConcept in class ConceptOperator
Throws:
M4CompilerError

getTypeOfNewColumnSet

public java.lang.String getTypeOfNewColumnSet()
Always returns 'T' as the new columnset is a table

Specified by:
getTypeOfNewColumnSet in class SingleCSOperator
Returns:
The type of the new Columnset, either "V" or "T".
See Also:
edu.udo.cs.miningmart.m4.core.operator.ConceptOperator#getTypeOfNewColumnSet

mustCopyFeature

protected boolean mustCopyFeature(java.lang.String nameOfFeature)
It is never called.

Specified by:
mustCopyFeature in class ConceptOperator
Parameters:
nameOfFeature - Name of the feature in question.
Returns:
TRUE if this feature should be copied to the output concept, FALSE if not.

generateSQLDefinition

public java.lang.String generateSQLDefinition(java.lang.String selectPart)
                                       throws M4CompilerError
SQL definition of the table created for the output concept is simply the name of this table.

Specified by:
generateSQLDefinition in class SingleCSOperator
Parameters:
selectPart - The SQL string between "SELECT" and "FROM" for the SQL definition to be returned.
Returns:
The SQL definition for the new ColumnSet.
Throws:
M4CompilerError

generateColumns

protected java.lang.String generateColumns(Columnset csForOutputConcept)
                                    throws M4CompilerError
Overrides the superclass method because the mapping is used.

Overrides:
generateColumns in class ConceptOperator
Parameters:
csForOutputConcept - The ColumnSet for which Columns are to be produced.
Returns:
A String for the "SELECT"-part of the view definition for the given ColumnSet.
Throws:
M4CompilerError
See Also:
miningmart.operator.ConceptOperator#generateColumns(Columnset)


Copyright © 2001-2005