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