예제 #1
0
  /**
   * Illustrates how to perform data normalization
   *
   * @param normalizeType type of normalization to perform
   * @param xformResult name of the result transformation view
   * @throws JDMException if transformation failed
   */
  public static void normalizeData(OraNormalizeType normalizeType, String xformResult)
      throws JDMException {
    // Schema where the original data and resulting transformations reside
    String schema = (m_dmeConn.getConnectionSpec().getName()).toUpperCase();

    OraNormalizeTransform ont =
        m_xformFactory.createNormalizeTransform(normalizeType, new Integer(6));

    // Specify the list of excluded attributes
    String[] excludedList = new String[] {"CUST_ID", "CUST_GENDER"};
    ont.setExcludeColumnList(excludedList);

    ArrayList xformList = new ArrayList();
    xformList.add(ont);
    // Create a transformation sequence object
    OraTransformationSequence xformSeq =
        m_xformFactory.createTransformationSequence(
            schema + "." + "MINING_DATA_BUILD_V", // name of the input data set
            xformList, // List of transformations. In this case only one type of transformation
            // i.e., supervised binning
            schema + "." + xformResult // name of the transformation result
            );
    String xformSeqName = "nmz_" + normalizeType.name() + "_xfSeq";
    m_dmeConn.saveObject(xformSeqName, xformSeq, true);

    OraTransformationTask xformTask = m_xformTaskFactory.create(xformSeqName, false);
    executeTask(xformTask, "xformNormalize_jdm");
    displayNormalizeResults(schema, "AGE", normalizeType, xformResult);
  }