@Test public void testGetTableStatisticsSampling() { MetastoreHiveStatisticsProvider statisticsProvider = new MetastoreHiveStatisticsProvider((table, hivePartitions) -> { assertEquals(table, TABLE); assertEquals(hivePartitions.size(), 1); return ImmutableMap.of(); }); TestingConnectorSession session = new TestingConnectorSession(new HiveSessionProperties( new HiveClientConfig().setPartitionStatisticsSampleSize(1), new OrcFileWriterConfig(), new ParquetFileWriterConfig()) .getSessionProperties()); statisticsProvider.getTableStatistics( session, TABLE, ImmutableMap.of(), ImmutableMap.of(), ImmutableList.of(partition("p1=string1/p2=1234"), partition("p1=string1/p2=1235"))); }
private ConnectorSession sampleSize(int sampleSize) { HiveSessionProperties properties = new HiveSessionProperties( getHiveClientConfig().setPartitionStatisticsSampleSize(sampleSize), new OrcFileWriterConfig(), new ParquetFileWriterConfig()); return new TestingConnectorSession(properties.getSessionProperties()); }
.setCreatesOfNonManagedTablesEnabled(false) .setHdfsWireEncryptionEnabled(true) .setPartitionStatisticsSampleSize(1234) .setIgnoreCorruptedStatistics(true) .setRecordingPath("/foo/bar")
@Test public void testGetTableStatisticsSampling() { MetastoreHiveStatisticsProvider statisticsProvider = new MetastoreHiveStatisticsProvider((table, hivePartitions) -> { assertEquals(table, TABLE); assertEquals(hivePartitions.size(), 1); return ImmutableMap.of(); }); TestingConnectorSession session = new TestingConnectorSession(new HiveSessionProperties( new HiveClientConfig().setPartitionStatisticsSampleSize(1), new OrcFileWriterConfig(), new ParquetFileWriterConfig()) .getSessionProperties()); statisticsProvider.getTableStatistics( session, TABLE, ImmutableMap.of(), ImmutableMap.of(), ImmutableList.of(partition("p1=string1/p2=1234"), partition("p1=string1/p2=1235"))); }
private ConnectorSession sampleSize(int sampleSize) { HiveSessionProperties properties = new HiveSessionProperties( getHiveClientConfig().setPartitionStatisticsSampleSize(sampleSize), new OrcFileWriterConfig(), new ParquetFileWriterConfig()); return new TestingConnectorSession(properties.getSessionProperties()); }
.setCreatesOfNonManagedTablesEnabled(false) .setHdfsWireEncryptionEnabled(true) .setPartitionStatisticsSampleSize(1234) .setIgnoreCorruptedStatistics(true) .setRecordingPath("/foo/bar")