Search in sources :

Example 1 with LowFrequencyIndicator

use of org.talend.dataquality.indicators.LowFrequencyIndicator in project tdq-studio-se by Talend.

the class FrequencyStatisticsExplorerTest method testGetFreqRowsStatement_2.

/**
 * Test method for {@link org.talend.dq.analysis.explore.FrequencyStatisticsExplorer#getFreqRowsStatement()} case_2:
 * for the column javaType is Text
 */
@Test
public void testGetFreqRowsStatement_2() {
    LowFrequencyIndicator indicator = creatFrenquceIndicator("CAL_TEXT", "TEXT", Types.LONGNVARCHAR);
    // $NON-NLS-1$  //$NON-NLS-2$
    ChartDataEntity chartDataEntity = new ChartDataEntity(indicator, "it is a long text", "1");
    chartDataEntity.setLabelNull(false);
    // $NON-NLS-1$
    chartDataEntity.setKey("it is a long text");
    assertFalse(chartDataEntity.isLabelNull());
    freqExp = new FrequencyStatisticsExplorer();
    freqExp.setAnalysis(ana);
    freqExp.setEnitty(chartDataEntity);
    String clause = freqExp.getFreqRowsStatement();
    // $NON-NLS-1$
    assertEquals("SELECT * FROM TDQ_CALENDAR WHERE  (CAL_TEXT = 'it is a long text') ", clause);
}
Also used : LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) Test(org.junit.Test)

Example 2 with LowFrequencyIndicator

use of org.talend.dataquality.indicators.LowFrequencyIndicator in project tdq-studio-se by Talend.

the class FrequencyStatisticsExplorerTest method creatFrenquceIndicator.

/**
 * DOC yyin Comment method "creatFrenquceIndicator".
 *
 * @return
 */
private LowFrequencyIndicator creatFrenquceIndicator(String columnName, String tdSqlName, int javaType) {
    // create database construction
    TdColumn column = UnitTestBuildHelper.createRealTdColumn(columnName, tdSqlName, javaType);
    // create indicator
    LowFrequencyIndicator indicator = IndicatorsFactory.eINSTANCE.createLowFrequencyIndicator();
    indicator.setAnalyzedElement(column);
    IndicatorParameters indicatorParameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    indicatorParameters.setDateParameters(null);
    indicator.setParameters(indicatorParameters);
    return indicator;
}
Also used : TdColumn(org.talend.cwm.relational.TdColumn) LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters)

Example 3 with LowFrequencyIndicator

use of org.talend.dataquality.indicators.LowFrequencyIndicator in project tdq-studio-se by Talend.

the class FrequencyStatisticsExplorerTest method testGetFreqRowsStatement_1.

/**
 * Test method for {@link org.talend.dq.analysis.explore.FrequencyStatisticsExplorer#getFreqRowsStatement()} case_1:
 * for the column javaType is Date
 */
@Test
public void testGetFreqRowsStatement_1() {
    LowFrequencyIndicator indicator = creatFrenquceIndicator("CAL_DATE", "DATE", Types.DATE);
    // $NON-NLS-1$  //$NON-NLS-2$
    ChartDataEntity chartDataEntity = new ChartDataEntity(indicator, "2012-06-05", "1");
    chartDataEntity.setLabelNull(false);
    // $NON-NLS-1$
    chartDataEntity.setKey("2012-06-05");
    assertFalse(chartDataEntity.isLabelNull());
    freqExp = new FrequencyStatisticsExplorer();
    freqExp.setAnalysis(ana);
    freqExp.setEnitty(chartDataEntity);
    String clause = freqExp.getFreqRowsStatement();
    // $NON-NLS-1$
    assertEquals("SELECT * FROM TDQ_CALENDAR WHERE  (CAL_DATE = '2012-06-05') ", clause);
}
Also used : LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) Test(org.junit.Test)

Example 4 with LowFrequencyIndicator

use of org.talend.dataquality.indicators.LowFrequencyIndicator in project tdq-studio-se by Talend.

the class FrequencyStatisticsExplorerTest method testGetFreqRowsStatement_3.

/**
 * Test method for {@link org.talend.dq.analysis.explore.FrequencyStatisticsExplorer#getFreqRowsStatement()} case_3:
 * for for the column javaType is Number
 */
@Test
public void testGetFreqRowsStatement_3() {
    LowFrequencyIndicator indicator = creatFrenquceIndicator("CAL_NUMBER", "NUMBER", Types.BIGINT);
    // $NON-NLS-1$  //$NON-NLS-2$
    ChartDataEntity chartDataEntity = new ChartDataEntity(indicator, "12345", "1");
    chartDataEntity.setLabelNull(false);
    // $NON-NLS-1$
    chartDataEntity.setKey("12345");
    assertFalse(chartDataEntity.isLabelNull());
    freqExp = new FrequencyStatisticsExplorer();
    freqExp.setAnalysis(ana);
    freqExp.setEnitty(chartDataEntity);
    String clause = freqExp.getFreqRowsStatement();
    // $NON-NLS-1$
    assertEquals("SELECT * FROM TDQ_CALENDAR WHERE  (CAL_NUMBER = '12345') ", clause);
}
Also used : LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) Test(org.junit.Test)

Example 5 with LowFrequencyIndicator

use of org.talend.dataquality.indicators.LowFrequencyIndicator in project tdq-studio-se by Talend.

the class IndicatorParametersImplTest method testEBasicSetContainerInternalEObjectInt.

/**
 * Test method for
 * {@link org.talend.dataquality.indicators.impl.IndicatorParametersImpl#eBasicSetContainer(org.eclipse.emf.ecore.InternalEObject, int)}
 * .
 */
@Test
public void testEBasicSetContainerInternalEObjectInt() {
    IndicatorDefaultValueServiceUtil.getIstance().getIndicatorDVService().setFrequencyLimitResult(FREQUENCYRESULTLIMIT);
    IndicatorDefaultValueServiceUtil.getIstance().getIndicatorDVService().setLowFrequencyLimitResult(LOWFREQUENCYRESULTLIMIT);
    // freqyency value indicator
    FrequencyIndicator createFrequencyIndicator = IndicatorsFactory.eINSTANCE.createFrequencyIndicator();
    createFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createFrequencyIndicator.getParameters().getTopN());
    // low freqyency value indicator
    LowFrequencyIndicator createLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createLowFrequencyIndicator();
    createLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createLowFrequencyIndicator.getParameters().getTopN());
    // date freqyency value indicator
    DateFrequencyIndicator createDateFrequencyIndicator = IndicatorsFactory.eINSTANCE.createDateFrequencyIndicator();
    createDateFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createDateFrequencyIndicator.getParameters().getTopN());
    // date low freqyency value indicator
    DateLowFrequencyIndicator createDateLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createDateLowFrequencyIndicator();
    createDateLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createDateLowFrequencyIndicator.getParameters().getTopN());
    // week freqyency value indicator
    WeekFrequencyIndicator createWeekFrequencyIndicator = IndicatorsFactory.eINSTANCE.createWeekFrequencyIndicator();
    createWeekFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createWeekFrequencyIndicator.getParameters().getTopN());
    // week low freqyency value indicator
    WeekLowFrequencyIndicator createWeekLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createWeekLowFrequencyIndicator();
    createWeekLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createWeekLowFrequencyIndicator.getParameters().getTopN());
    // Month freqyency value indicator
    MonthFrequencyIndicator createMonthFrequencyIndicator = IndicatorsFactory.eINSTANCE.createMonthFrequencyIndicator();
    createMonthFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createMonthFrequencyIndicator.getParameters().getTopN());
    // Month low freqyency value indicator
    MonthLowFrequencyIndicator createMonthLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createMonthLowFrequencyIndicator();
    createMonthLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createMonthLowFrequencyIndicator.getParameters().getTopN());
    // quarter freqyency value indicator
    QuarterFrequencyIndicator createQuarterFrequencyIndicator = IndicatorsFactory.eINSTANCE.createQuarterFrequencyIndicator();
    createQuarterFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createQuarterFrequencyIndicator.getParameters().getTopN());
    // quarter low freqyency value indicator
    QuarterLowFrequencyIndicator createQuarterLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createQuarterLowFrequencyIndicator();
    createQuarterLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createQuarterLowFrequencyIndicator.getParameters().getTopN());
    // year freqyency value indicator
    YearFrequencyIndicator createYearFrequencyIndicator = IndicatorsFactory.eINSTANCE.createYearFrequencyIndicator();
    createYearFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createYearFrequencyIndicator.getParameters().getTopN());
    // year low freqyency value indicator
    YearLowFrequencyIndicator createYearLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createYearLowFrequencyIndicator();
    createYearLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createYearLowFrequencyIndicator.getParameters().getTopN());
    // bin freqyency value indicator
    BinFrequencyIndicator createBinFrequencyIndicator = IndicatorsFactory.eINSTANCE.createBinFrequencyIndicator();
    createBinFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createBinFrequencyIndicator.getParameters().getTopN());
    // bin low freqyency value indicator
    BinLowFrequencyIndicator createBinLowFrequencyIndicator = IndicatorsFactory.eINSTANCE.createBinLowFrequencyIndicator();
    createBinLowFrequencyIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createBinLowFrequencyIndicator.getParameters().getTopN());
    // pattern freqyency value indicator
    PatternFreqIndicator createPatternFreqIndicator = IndicatorsFactory.eINSTANCE.createPatternFreqIndicator();
    createPatternFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createPatternFreqIndicator.getParameters().getTopN());
    // pattern low freqyency value indicator
    PatternLowFreqIndicator createPatternLowFreqIndicator = IndicatorsFactory.eINSTANCE.createPatternLowFreqIndicator();
    createPatternLowFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createPatternLowFreqIndicator.getParameters().getTopN());
    // east asia freqyency value indicator
    EastAsiaPatternFreqIndicator createEastAsiaPatternFreqIndicator = IndicatorsFactory.eINSTANCE.createEastAsiaPatternFreqIndicator();
    createEastAsiaPatternFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createEastAsiaPatternFreqIndicator.getParameters().getTopN());
    // east asia low freqyency value indicator
    EastAsiaPatternLowFreqIndicator createEastAsiaPatternLowFreqIndicator = IndicatorsFactory.eINSTANCE.createEastAsiaPatternLowFreqIndicator();
    createEastAsiaPatternLowFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createEastAsiaPatternLowFreqIndicator.getParameters().getTopN());
    // soundex freqyency value indicator
    SoundexFreqIndicator createSoundexFreqIndicator = IndicatorsFactory.eINSTANCE.createSoundexFreqIndicator();
    createSoundexFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createSoundexFreqIndicator.getParameters().getTopN());
    // soundex low freqyency value indicator
    SoundexLowFreqIndicator createSoundexLowFreqIndicator = IndicatorsFactory.eINSTANCE.createSoundexLowFreqIndicator();
    createSoundexLowFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(LOWFREQUENCYRESULTLIMIT, createSoundexLowFreqIndicator.getParameters().getTopN());
    // Date pattern freqyency value indicator
    DatePatternFreqIndicator createDatePatternFreqIndicator = IndicatorsFactory.eINSTANCE.createDatePatternFreqIndicator();
    createDatePatternFreqIndicator.setParameters(IndicatorsFactory.eINSTANCE.createIndicatorParameters());
    Assert.assertEquals(FREQUENCYRESULTLIMIT, createDatePatternFreqIndicator.getParameters().getTopN());
}
Also used : QuarterLowFrequencyIndicator(org.talend.dataquality.indicators.QuarterLowFrequencyIndicator) BinLowFrequencyIndicator(org.talend.dataquality.indicators.BinLowFrequencyIndicator) WeekLowFrequencyIndicator(org.talend.dataquality.indicators.WeekLowFrequencyIndicator) DateLowFrequencyIndicator(org.talend.dataquality.indicators.DateLowFrequencyIndicator) LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) MonthLowFrequencyIndicator(org.talend.dataquality.indicators.MonthLowFrequencyIndicator) YearLowFrequencyIndicator(org.talend.dataquality.indicators.YearLowFrequencyIndicator) QuarterFrequencyIndicator(org.talend.dataquality.indicators.QuarterFrequencyIndicator) DateFrequencyIndicator(org.talend.dataquality.indicators.DateFrequencyIndicator) EastAsiaPatternFreqIndicator(org.talend.dataquality.indicators.EastAsiaPatternFreqIndicator) MonthLowFrequencyIndicator(org.talend.dataquality.indicators.MonthLowFrequencyIndicator) YearLowFrequencyIndicator(org.talend.dataquality.indicators.YearLowFrequencyIndicator) EastAsiaPatternLowFreqIndicator(org.talend.dataquality.indicators.EastAsiaPatternLowFreqIndicator) PatternLowFreqIndicator(org.talend.dataquality.indicators.PatternLowFreqIndicator) SoundexFreqIndicator(org.talend.dataquality.indicators.SoundexFreqIndicator) QuarterLowFrequencyIndicator(org.talend.dataquality.indicators.QuarterLowFrequencyIndicator) QuarterFrequencyIndicator(org.talend.dataquality.indicators.QuarterFrequencyIndicator) FrequencyIndicator(org.talend.dataquality.indicators.FrequencyIndicator) BinLowFrequencyIndicator(org.talend.dataquality.indicators.BinLowFrequencyIndicator) WeekLowFrequencyIndicator(org.talend.dataquality.indicators.WeekLowFrequencyIndicator) DateLowFrequencyIndicator(org.talend.dataquality.indicators.DateLowFrequencyIndicator) LowFrequencyIndicator(org.talend.dataquality.indicators.LowFrequencyIndicator) WeekFrequencyIndicator(org.talend.dataquality.indicators.WeekFrequencyIndicator) YearFrequencyIndicator(org.talend.dataquality.indicators.YearFrequencyIndicator) BinFrequencyIndicator(org.talend.dataquality.indicators.BinFrequencyIndicator) DateFrequencyIndicator(org.talend.dataquality.indicators.DateFrequencyIndicator) MonthLowFrequencyIndicator(org.talend.dataquality.indicators.MonthLowFrequencyIndicator) MonthFrequencyIndicator(org.talend.dataquality.indicators.MonthFrequencyIndicator) YearLowFrequencyIndicator(org.talend.dataquality.indicators.YearLowFrequencyIndicator) WeekLowFrequencyIndicator(org.talend.dataquality.indicators.WeekLowFrequencyIndicator) EastAsiaPatternLowFreqIndicator(org.talend.dataquality.indicators.EastAsiaPatternLowFreqIndicator) YearFrequencyIndicator(org.talend.dataquality.indicators.YearFrequencyIndicator) DateLowFrequencyIndicator(org.talend.dataquality.indicators.DateLowFrequencyIndicator) DatePatternFreqIndicator(org.talend.dataquality.indicators.DatePatternFreqIndicator) BinFrequencyIndicator(org.talend.dataquality.indicators.BinFrequencyIndicator) QuarterLowFrequencyIndicator(org.talend.dataquality.indicators.QuarterLowFrequencyIndicator) BinLowFrequencyIndicator(org.talend.dataquality.indicators.BinLowFrequencyIndicator) MonthFrequencyIndicator(org.talend.dataquality.indicators.MonthFrequencyIndicator) SoundexLowFreqIndicator(org.talend.dataquality.indicators.SoundexLowFreqIndicator) DatePatternFreqIndicator(org.talend.dataquality.indicators.DatePatternFreqIndicator) EastAsiaPatternFreqIndicator(org.talend.dataquality.indicators.EastAsiaPatternFreqIndicator) PatternFreqIndicator(org.talend.dataquality.indicators.PatternFreqIndicator) WeekFrequencyIndicator(org.talend.dataquality.indicators.WeekFrequencyIndicator) Test(org.junit.Test)

Aggregations

LowFrequencyIndicator (org.talend.dataquality.indicators.LowFrequencyIndicator)5 Test (org.junit.Test)4 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)3 TdColumn (org.talend.cwm.relational.TdColumn)1 BinFrequencyIndicator (org.talend.dataquality.indicators.BinFrequencyIndicator)1 BinLowFrequencyIndicator (org.talend.dataquality.indicators.BinLowFrequencyIndicator)1 DateFrequencyIndicator (org.talend.dataquality.indicators.DateFrequencyIndicator)1 DateLowFrequencyIndicator (org.talend.dataquality.indicators.DateLowFrequencyIndicator)1 DatePatternFreqIndicator (org.talend.dataquality.indicators.DatePatternFreqIndicator)1 EastAsiaPatternFreqIndicator (org.talend.dataquality.indicators.EastAsiaPatternFreqIndicator)1 EastAsiaPatternLowFreqIndicator (org.talend.dataquality.indicators.EastAsiaPatternLowFreqIndicator)1 FrequencyIndicator (org.talend.dataquality.indicators.FrequencyIndicator)1 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)1 MonthFrequencyIndicator (org.talend.dataquality.indicators.MonthFrequencyIndicator)1 MonthLowFrequencyIndicator (org.talend.dataquality.indicators.MonthLowFrequencyIndicator)1 PatternFreqIndicator (org.talend.dataquality.indicators.PatternFreqIndicator)1 PatternLowFreqIndicator (org.talend.dataquality.indicators.PatternLowFreqIndicator)1 QuarterFrequencyIndicator (org.talend.dataquality.indicators.QuarterFrequencyIndicator)1 QuarterLowFrequencyIndicator (org.talend.dataquality.indicators.QuarterLowFrequencyIndicator)1 SoundexFreqIndicator (org.talend.dataquality.indicators.SoundexFreqIndicator)1