edu.udo.cs.miningmart.operator
Class ReversePivotize

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.ReversePivotize

public class ReversePivotize
extends SingleCSOperator

This operator denormalizes or flattens out certain attributes, which is called Pivotizing. This means that for each value that occurs in the column of one or two "index" attributes, a new attribute is created. This new attribute contains the aggregation over those values of the "pivot" attribute where the index attribute(s) took the value that corresponds to the new attribute. Example where aggregation is done by summing up (I = index attribute, P = pivotised attribute): Input Output I | P P_M | P_F ------ ---------- M | 4 => 6 | 5 M | 2 F | 5

Version:
$Id: ReversePivotize.java,v 1.1 2006/05/19 16:24:05 euler Exp $
Author:
Timm Euler

Field Summary
static java.lang.String PARAMETER_KEY_ATTR
           
static java.lang.String PARAMETER_NAME_PIVOT
           
static java.lang.String PARAMETER_NAMES_INDEX_ATTRS
           
static java.lang.String PARAMETER_PIVOT_ATTRS
           
static java.lang.String PARAMETER_VALUES
           
 
Fields inherited from class edu.udo.cs.miningmart.operator.ExecutableOperator
generatedSQLDefinitions
 
Constructor Summary
ReversePivotize()
           
 
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.SingleCSOperator
generateColumnSetsForOp, generateSQLDefinition, getNewCSName, getTypeOfNewColumnSet
 
Methods inherited from class edu.udo.cs.miningmart.operator.ConceptOperator
compileStatement, createMetadata, createMetadataForOneBA, createSingleColumnSet, createStatement, estimateStatistics, getInputConcept, 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, load, print, putM4ObjectToCache, showCreateStatement, storedProceduresAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ReversePivotize

public ReversePivotize()
Method Detail

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