edu.udo.cs.miningmart.operator
Class ReversePivotize
java.lang.Object
edu.udo.cs.miningmart.operator.ExecutableOperator
edu.udo.cs.miningmart.operator.ConceptOperator
edu.udo.cs.miningmart.operator.SingleCSOperator
edu.udo.cs.miningmart.operator.ReversePivotize
public class ReversePivotize
- extends SingleCSOperator
This operator folds some given attributes into one, which is called
Reverse Pivotizing. Each of the given attributes represents a combination
of "index values"; in the output, each such combination is represented as a row,
using as many index attributes as there are types of index values. The row
takes the value of the given attributes it corresponds to.
For example (input left, output right):
Date | RainDuringDay | RainDuringNight Date | TimeOfDay | Rain
-----|---------------|---------------- -----|-----------|-----
01-01| 44 | 35 01-01| Day | 44
02-01| 36 | 32 01-01| Night | 35
02-01| Day | 36
02-01| Night | 32
- Version:
- $Id: ReversePivotize.java,v 1.6 2006/09/27 14:59:56 euler Exp $
- Author:
- Timm Euler
|
Method Summary |
protected java.lang.String |
generateColumns(Columnset csForOutputConcept)
This method is overridden because this operator creates a special output. |
java.lang.String |
generateSQLDefinition(java.lang.String selectPart)
This method must return the SQL definition of the newly created ColumnSet. |
static java.lang.String |
getConDataTypeOfIndexAttr(java.lang.String nameOfIndexAttr,
java.lang.String[] indexValues,
java.lang.String[] indexAttrNames)
|
static java.lang.String |
getConDataTypeOfPivotAttr(BaseAttribute[] pivotAttrs)
|
java.lang.String |
getTypeOfNewColumnSet()
This method must return the entry String for the M4 table "Columnset_t",
indicating whether the new Columnset is a view or a table. |
protected boolean |
mustCopyFeature(java.lang.String nameOfFeature)
This method is never called. |
| 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, getParameterObjectsOfAllLoops, getSingleParameter, getSingleParameter, getStep, giveWarningForChangedInputData, handleAssertions, isDeselectedParameter, isLoopable, isManual, isStepable, load, print, putM4ObjectToCache, showCreateStatement, storedProceduresAvailable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PARAMETER_PIVOT_ATTRS
public static final java.lang.String PARAMETER_PIVOT_ATTRS
- See Also:
- Constant Field Values
PARAMETER_VALUES
public static final java.lang.String PARAMETER_VALUES
- See Also:
- Constant Field Values
PARAMETER_KEY_ATTR
public static final java.lang.String PARAMETER_KEY_ATTR
- See Also:
- Constant Field Values
PARAMETER_NAME_PIVOT
public static final java.lang.String PARAMETER_NAME_PIVOT
- See Also:
- Constant Field Values
PARAMETER_NAMES_INDEX_ATTRS
public static final java.lang.String PARAMETER_NAMES_INDEX_ATTRS
- See Also:
- Constant Field Values
ReversePivotize
public ReversePivotize()
getTypeOfNewColumnSet
public java.lang.String getTypeOfNewColumnSet()
- Description copied from class:
SingleCSOperator
- This method must return the entry String for the M4 table "Columnset_t",
indicating whether the new Columnset is a view or a table.
- Specified by:
getTypeOfNewColumnSet in class SingleCSOperator
- Returns:
- The type of the new Columnset, either "V" or "T".
- See Also:
miningmart.compiler.operator.SingleCSOperator#getTypeOfNewColumnSet()
generateSQLDefinition
public java.lang.String generateSQLDefinition(java.lang.String selectPart)
throws M4CompilerError
- Description copied from class:
SingleCSOperator
- This method must return the SQL definition of the newly created ColumnSet.
- 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- See Also:
SingleCSOperator.generateSQLDefinition(String)
generateColumns
protected java.lang.String generateColumns(Columnset csForOutputConcept)
throws M4CompilerError
- This method is overridden because this operator creates a special output.
- 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:
edu.udo.cs.miningmart.m4.operator.ConceptOperator#generateColumns(Columnset)
mustCopyFeature
protected boolean mustCopyFeature(java.lang.String nameOfFeature)
throws M4CompilerError
- This method 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.
- Throws:
M4CompilerError- See Also:
miningmart.compiler.operator.ConceptOperator#mustCopyFeature(String)
getConDataTypeOfPivotAttr
public static java.lang.String getConDataTypeOfPivotAttr(BaseAttribute[] pivotAttrs)
throws M4Exception
- Throws:
M4Exception
getConDataTypeOfIndexAttr
public static java.lang.String getConDataTypeOfIndexAttr(java.lang.String nameOfIndexAttr,
java.lang.String[] indexValues,
java.lang.String[] indexAttrNames)
throws M4Exception
- Throws:
M4Exception
Copyright © 2001-2005