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);
}
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);
}
Aggregations