Java Code Examples for org.apache.hadoop.hive.metastore.api.BinaryColumnStatsData#setNumNulls()
The following examples show how to use
org.apache.hadoop.hive.metastore.api.BinaryColumnStatsData#setNumNulls() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestThriftMetastoreUtil.java From presto with Apache License 2.0 | 6 votes |
@Test public void testBinaryStatsToColumnStatistics() { BinaryColumnStatsData binaryColumnStatsData = new BinaryColumnStatsData(); binaryColumnStatsData.setMaxColLen(100); binaryColumnStatsData.setAvgColLen(22.2); binaryColumnStatsData.setNumNulls(2); ColumnStatisticsObj columnStatisticsObj = new ColumnStatisticsObj("my_col", BINARY_TYPE_NAME, binaryStats(binaryColumnStatsData)); HiveColumnStatistics actual = fromMetastoreApiColumnStatistics(columnStatisticsObj, OptionalLong.of(4)); assertEquals(actual.getIntegerStatistics(), Optional.empty()); assertEquals(actual.getDoubleStatistics(), Optional.empty()); assertEquals(actual.getDecimalStatistics(), Optional.empty()); assertEquals(actual.getDateStatistics(), Optional.empty()); assertEquals(actual.getBooleanStatistics(), Optional.empty()); assertEquals(actual.getMaxValueSizeInBytes(), OptionalLong.of(100)); assertEquals(actual.getTotalSizeInBytes(), OptionalLong.of(44)); assertEquals(actual.getNullsCount(), OptionalLong.of(2)); assertEquals(actual.getDistinctValuesCount(), OptionalLong.empty()); }
Example 2
Source File: TestObjects.java From aws-glue-data-catalog-client-for-apache-hive-metastore with Apache License 2.0 | 5 votes |
public static org.apache.hadoop.hive.metastore.api.ColumnStatisticsData getHiveBinaryColumnStatsData() { BinaryColumnStatsData statsData = new BinaryColumnStatsData(); statsData.setAvgColLen(12.3); statsData.setMaxColLen(45L); statsData.setNumNulls(56L); org.apache.hadoop.hive.metastore.api.ColumnStatisticsData statsWrapper = new org.apache.hadoop.hive.metastore.api.ColumnStatisticsData(); statsWrapper.setBinaryStats(statsData); return statsWrapper; }