Search in sources :

Example 6 with ColumnStatistics

use of com.amazonaws.services.glue.model.ColumnStatistics in project alluxio by Alluxio.

the class GlueUtilsTest method protoColStatsWithLongData.

@Test
public void protoColStatsWithLongData() {
    // ColumnStatistics required fields: AnalyzedTime, ColumnName, ColumnType, StatisticsData
    ColumnStatistics glueColStats = new ColumnStatistics();
    glueColStats.setColumnName("colName");
    glueColStats.setColumnType("colType");
    ColumnStatisticsData data = new ColumnStatisticsData();
    // verify empty data
    data.setType("LONG");
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
    // verify non-empty data
    LongColumnStatisticsData longData = new LongColumnStatisticsData();
    longData.setMaximumValue(mRandom.nextLong());
    longData.setMinimumValue(mRandom.nextLong());
    longData.setNumberOfNulls(mRandom.nextLong());
    longData.setNumberOfDistinctValues(mRandom.nextLong());
    data.setLongColumnStatisticsData(longData);
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
    // verify null column values
    longData.setMaximumValue(null);
    longData.setMinimumValue(null);
    data.setLongColumnStatisticsData(longData);
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
}
Also used : ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) LongColumnStatisticsData(com.amazonaws.services.glue.model.LongColumnStatisticsData) DecimalColumnStatisticsData(com.amazonaws.services.glue.model.DecimalColumnStatisticsData) DateColumnStatisticsData(com.amazonaws.services.glue.model.DateColumnStatisticsData) LongColumnStatisticsData(com.amazonaws.services.glue.model.LongColumnStatisticsData) ColumnStatisticsData(com.amazonaws.services.glue.model.ColumnStatisticsData) BooleanColumnStatisticsData(com.amazonaws.services.glue.model.BooleanColumnStatisticsData) BinaryColumnStatisticsData(com.amazonaws.services.glue.model.BinaryColumnStatisticsData) DoubleColumnStatisticsData(com.amazonaws.services.glue.model.DoubleColumnStatisticsData) StringColumnStatisticsData(com.amazonaws.services.glue.model.StringColumnStatisticsData) Test(org.junit.Test)

Example 7 with ColumnStatistics

use of com.amazonaws.services.glue.model.ColumnStatistics in project alluxio by Alluxio.

the class GlueUtilsTest method protoColStatsWithDoubleData.

@Test
public void protoColStatsWithDoubleData() {
    // ColumnStatistics required fields: AnalyzedTime, ColumnName, ColumnType, StatisticsData
    ColumnStatistics glueColStats = new ColumnStatistics();
    glueColStats.setColumnName("colName");
    glueColStats.setColumnType("colType");
    ColumnStatisticsData data = new ColumnStatisticsData();
    // verify empty data
    data.setType("DOUBLE");
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
    // verify non-empty data
    DoubleColumnStatisticsData doubleData = new DoubleColumnStatisticsData();
    doubleData.setMaximumValue(mRandom.nextDouble());
    doubleData.setMinimumValue(mRandom.nextDouble());
    doubleData.setNumberOfNulls(mRandom.nextLong());
    doubleData.setNumberOfDistinctValues(mRandom.nextLong());
    data.setDoubleColumnStatisticsData(doubleData);
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
    // verify null column values
    doubleData.setMaximumValue(null);
    doubleData.setMinimumValue(null);
    data.setDoubleColumnStatisticsData(doubleData);
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
}
Also used : ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) DoubleColumnStatisticsData(com.amazonaws.services.glue.model.DoubleColumnStatisticsData) DecimalColumnStatisticsData(com.amazonaws.services.glue.model.DecimalColumnStatisticsData) DateColumnStatisticsData(com.amazonaws.services.glue.model.DateColumnStatisticsData) LongColumnStatisticsData(com.amazonaws.services.glue.model.LongColumnStatisticsData) ColumnStatisticsData(com.amazonaws.services.glue.model.ColumnStatisticsData) BooleanColumnStatisticsData(com.amazonaws.services.glue.model.BooleanColumnStatisticsData) BinaryColumnStatisticsData(com.amazonaws.services.glue.model.BinaryColumnStatisticsData) DoubleColumnStatisticsData(com.amazonaws.services.glue.model.DoubleColumnStatisticsData) StringColumnStatisticsData(com.amazonaws.services.glue.model.StringColumnStatisticsData) Test(org.junit.Test)

Aggregations

BinaryColumnStatisticsData (com.amazonaws.services.glue.model.BinaryColumnStatisticsData)7 BooleanColumnStatisticsData (com.amazonaws.services.glue.model.BooleanColumnStatisticsData)7 ColumnStatistics (com.amazonaws.services.glue.model.ColumnStatistics)7 ColumnStatisticsData (com.amazonaws.services.glue.model.ColumnStatisticsData)7 DateColumnStatisticsData (com.amazonaws.services.glue.model.DateColumnStatisticsData)7 DecimalColumnStatisticsData (com.amazonaws.services.glue.model.DecimalColumnStatisticsData)7 DoubleColumnStatisticsData (com.amazonaws.services.glue.model.DoubleColumnStatisticsData)7 LongColumnStatisticsData (com.amazonaws.services.glue.model.LongColumnStatisticsData)7 StringColumnStatisticsData (com.amazonaws.services.glue.model.StringColumnStatisticsData)7 Test (org.junit.Test)7 DecimalNumber (com.amazonaws.services.glue.model.DecimalNumber)1 Date (java.util.Date)1