()
| 359 | } |
| 360 | |
| 361 | @Override |
| 362 | public ColumnStatistics[] getStatistics() { |
| 363 | ColumnStatistics[] result = deserializeStats(schema, fileStats); |
| 364 | if (encryption.getKeys().length > 0) { |
| 365 | try (CompressionCodec codec = OrcCodecPool.getCodec(compressionKind)) { |
| 366 | InStream.StreamOptions compression = InStream.options(); |
| 367 | if (codec != null) { |
| 368 | compression.withCodec(codec).withBufferSize(bufferSize); |
| 369 | } |
| 370 | for (int c = schema.getId(); c <= schema.getMaximumId(); ++c) { |
| 371 | ReaderEncryptionVariant variant = encryption.getVariant(c); |
| 372 | if (variant != null) { |
| 373 | try { |
| 374 | int base = variant.getRoot().getId(); |
| 375 | ColumnStatistics[] overrides = decryptFileStats(variant, |
| 376 | compression, tail.getFooter()); |
| 377 | for(int sub=0; sub < overrides.length; ++sub) { |
| 378 | result[base + sub] = overrides[sub]; |
| 379 | } |
| 380 | } catch (IOException e) { |
| 381 | throw new RuntimeException("Can't decrypt file stats for " + path + |
| 382 | " with " + variant.getKeyDescription()); |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | return result; |
| 389 | } |
| 390 | |
| 391 | private ColumnStatistics[] decryptFileStats(ReaderEncryptionVariant encryption, |
| 392 | InStream.StreamOptions compression, |
nothing calls this directly
no test coverage detected