Search in sources :

Example 6 with ColumnStatisticsData

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

the class GlueUtilsTest method protoColStatsWithStringData.

@Test
public void protoColStatsWithStringData() {
    // 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("STRING");
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
    // verify non-empty data
    StringColumnStatisticsData stringData = new StringColumnStatisticsData();
    stringData.setMaximumLength(mRandom.nextLong());
    stringData.setAverageLength(mRandom.nextDouble());
    stringData.setNumberOfNulls(mRandom.nextLong());
    stringData.setNumberOfDistinctValues(mRandom.nextLong());
    data.setStringColumnStatisticsData(stringData);
    glueColStats.setStatisticsData(data);
    verifyColumnStats(glueColStats);
}
Also used : ColumnStatistics(com.amazonaws.services.glue.model.ColumnStatistics) StringColumnStatisticsData(com.amazonaws.services.glue.model.StringColumnStatisticsData) 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 ColumnStatisticsData

use of com.amazonaws.services.glue.model.ColumnStatisticsData 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 8 with ColumnStatisticsData

use of com.amazonaws.services.glue.model.ColumnStatisticsData 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)8 BooleanColumnStatisticsData (com.amazonaws.services.glue.model.BooleanColumnStatisticsData)8 ColumnStatisticsData (com.amazonaws.services.glue.model.ColumnStatisticsData)8 DateColumnStatisticsData (com.amazonaws.services.glue.model.DateColumnStatisticsData)8 DecimalColumnStatisticsData (com.amazonaws.services.glue.model.DecimalColumnStatisticsData)8 DoubleColumnStatisticsData (com.amazonaws.services.glue.model.DoubleColumnStatisticsData)8 LongColumnStatisticsData (com.amazonaws.services.glue.model.LongColumnStatisticsData)8 StringColumnStatisticsData (com.amazonaws.services.glue.model.StringColumnStatisticsData)8 ColumnStatistics (com.amazonaws.services.glue.model.ColumnStatistics)7 Test (org.junit.Test)7 ColumnStatisticsInfo (alluxio.grpc.table.ColumnStatisticsInfo)1 DecimalNumber (com.amazonaws.services.glue.model.DecimalNumber)1 Date (java.util.Date)1