diff --git a/db/compaction.cc b/db/compaction.cc index e88e822b2..0c758cc39 100644 --- a/db/compaction.cc +++ b/db/compaction.cc @@ -266,5 +266,4 @@ uint64_t Compaction::OutputFilePreallocationSize() { return preallocation_size * 1.1; } - } // namespace rocksdb diff --git a/tools/sst_dump.cc b/tools/sst_dump.cc index 9a144bb0b..8e1ae35a9 100644 --- a/tools/sst_dump.cc +++ b/tools/sst_dump.cc @@ -132,6 +132,16 @@ Status SstFileReader::SetTableOptionsByMagicNumber(uint64_t table_magic_number, if (table_magic_number == kBlockBasedTableMagicNumber) { options_.table_factory = std::make_shared(); fprintf(stdout, "Sst file format: block-based\n"); + auto& props = table_properties->user_collected_properties; + auto pos = props.find(BlockBasedTablePropertyNames::kIndexType); + if (pos != props.end()) { + auto index_type_on_file = static_cast( + DecodeFixed32(pos->second.c_str())); + if (index_type_on_file == + BlockBasedTableOptions::IndexType::kHashSearch) { + options_.prefix_extractor.reset(NewNoopTransform()); + } + } } else if (table_magic_number == kPlainTableMagicNumber) { options_.allow_mmap_reads = true; options_.table_factory = std::make_shared(