Skip to content

refactor(reader): Move the reader factory out of fb/ (#1069) - #1069

Open
HuamengJiang wants to merge 1 commit into
facebookincubator:mainfrom
HuamengJiang:export-D114807828
Open

refactor(reader): Move the reader factory out of fb/ (#1069)#1069
HuamengJiang wants to merge 1 commit into
facebookincubator:mainfrom
HuamengJiang:export-D114807828

Conversation

@HuamengJiang

@HuamengJiang HuamengJiang commented Aug 5, 2026

Copy link
Copy Markdown

Summary:

Gets the NIMBLE reader's registration surface out of fb/, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, NimbleReaderFactory -- and with it registerNimbleReaderFactory(), which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in dwio/nimble/velox/reader/fb/NimbleReader.h. Nothing about the factory is internal: it holds a SelectiveNimbleReaderFactory, reads one flag, and picks a reader. It was stuck in fb/ by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (//dwio/api:velox-util).

So the edge is inverted rather than the factory being kept hostage to it:

  • dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp} is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
  • The batch branch now goes through detail::createBatchReader(), declared in that header and defined once per build flavour: fb/NimbleReader.cpp for Buck, BatchReaderOSS.cpp for CMake. This is the same ODR-based split already used for detail::defaultMetadata() (VeloxWriterDefaultMetadataOSS.cpp) and detail::initHook() (SelectiveNimbleReaderInitHookOSS.cpp).
  • fb/NimbleReader.h is deleted. With the factory gone it declared nothing, since the batch NimbleReader and NimbleRowReader live in an anonymous namespace in the .cpp.
  • fb/ keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and FieldIdResolver.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: FileConfig::kSelectiveNimbleReaderEnabledSession and QueryConfig::kSelectiveNimbleReaderEnabled both default to true, so every engine-driven read already takes the selective branch.

The 28 #include sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, nimble_velox_reader_factory is a new library and add_subdirectory(reader) is ordered after selective, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: mrs/ranklake/table_service/src/storage/table:nimble_index_tablet is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs ReaderOptions{pool, &dataIoStats, &metadataIoStats} against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 5, 2026
@meta-codesync

meta-codesync Bot commented Aug 5, 2026

Copy link
Copy Markdown

@HuamengJiang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114807828.

@meta-codesync meta-codesync Bot changed the title refactor(reader): Move the reader factory out of fb/ refactor(reader): Move the reader factory out of fb/ (#1069) Aug 6, 2026
HuamengJiang added a commit to HuamengJiang/nimble-1 that referenced this pull request Aug 6, 2026
…or#1069)

Summary:

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs `ReaderOptions{pool, &dataIoStats, &metadataIoStats}` against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
HuamengJiang added a commit to HuamengJiang/nimble-1 that referenced this pull request Aug 6, 2026
…or#1069)

Summary:

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs `ReaderOptions{pool, &dataIoStats, &metadataIoStats}` against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
HuamengJiang added a commit to HuamengJiang/nimble-1 that referenced this pull request Aug 7, 2026
…or#1069)

Summary:

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs `ReaderOptions{pool, &dataIoStats, &metadataIoStats}` against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
…or#1069)

Summary:

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs `ReaderOptions{pool, &dataIoStats, &metadataIoStats}` against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
HuamengJiang added a commit to HuamengJiang/velox-1 that referenced this pull request Aug 25, 2026
…or#18677)

Summary:

X-link: facebookincubator/nimble#1069

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links.

Behavior is unchanged on both branches; this is placement and linkage only.

Note for reviewers: `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the 28 consumers and does not build. That is pre-existing on trunk -- it constructs `ReaderOptions{pool, &dataIoStats, &metadataIoStats}` against a class that only has a one-argument constructor -- and I verified it fails identically with this change shelved. Its include is updated for consistency, but the target is left otherwise untouched.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
HuamengJiang added a commit to HuamengJiang/velox-1 that referenced this pull request Aug 25, 2026
…or#18677)

Summary:

X-link: facebookincubator/nimble#1069

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links. The new `NimbleReaderFactory.h` is listed in the `add_library()` source list because velox's `check-header-ownership` pre-commit hook requires every OSS-exported `.h` to be named by some `CMakeLists.txt` target.

Behavior of the reader path is unchanged on both branches; this is placement and linkage only.

Note for reviewers -- one unrelated build fix is folded in, at #ranklake's target. `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the consumers of the moved header, and it did not build on trunk. The cause is unrelated to this refactor: `829e31d97d31` ("[velox]refactor: Add IO stats setters to ReaderOptions and use pool-only constructor", May 9 2026) removed the multi-argument `ReaderOptions` constructor, and `d78602ee9fb1` ("[velox] Refactor ReaderOptions IoStatistics from raw pointers to shared_ptr", May 15 2026) moved the stats to `shared_ptr`, but this call site was never ported and has been broken for roughly three months. Verified pre-existing: the failing statement is byte-identical on master. It went unnoticed because the target is orphaned -- `tablet_factory` wires up `json_tablet`, `sst_tablet` and `base_tablet` but not `nimble_index_tablet`, and `buck2 uquery "rdeps(fbcode//mrs/..., ...)"` returns nothing, so nothing depends on it and it has no tests.

The port is mechanical:

```
-  facebook::velox::io::IoStatistics dataIoStats;
-  facebook::velox::io::IoStatistics metadataIoStats;
-  facebook::velox::dwio::common::ReaderOptions readerOpts{
-      pool.get(), &dataIoStats, &metadataIoStats};
+  auto dataIoStats = std::make_shared<facebook::velox::io::IoStatistics>();
+  auto metadataIoStats = std::make_shared<facebook::velox::io::IoStatistics>();
+  facebook::velox::dwio::common::ReaderOptions readerOpts{pool.get()};
+  readerOpts.setDataIoStats(dataIoStats).setMetadataIoStats(metadataIoStats);
```

This also closes a latent dangling-pointer bug: the old form handed raw pointers to two stack locals into `readerOpts`, which feeds `nimbleReader_`, a member that outlives the function. The `shared_ptr` form keeps them alive, which is what the velox change was for.

Once the file compiled, CLANGTIDY could run on it for the first time and flagged a pre-existing `unused parameter 'blobData'` in the `mergeTabletBlobData` stub; that parameter name is now commented out. Verification there is compile-only, since the target has no tests and no dependents.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
HuamengJiang added a commit to HuamengJiang/velox-1 that referenced this pull request Aug 25, 2026
…or#18677)

Summary:

X-link: facebookincubator/nimble#1069

Gets the NIMBLE reader's registration surface out of `fb/`, so that internal and open-source builds register the same factory instead of each having their own entry point.

Before this, `NimbleReaderFactory` -- and with it `registerNimbleReaderFactory()`, which is what Prism, Gluten, Axel, Axiom, and a long tail of tools call -- lived in `dwio/nimble/velox/reader/fb/NimbleReader.h`. Nothing about the factory is internal: it holds a `SelectiveNimbleReaderFactory`, reads one flag, and picks a reader. It was stuck in `fb/` by a single edge, namely that it constructs the batch reader, which does depend on internal-only code (`//dwio/api:velox-util`).

So the edge is inverted rather than the factory being kept hostage to it:

- `dwio/nimble/velox/reader/NimbleReaderFactory.{h,cpp}` is new, OSS-clean, and holds the factory, the dispatch, and the register/unregister pair.
- The batch branch now goes through `detail::createBatchReader()`, declared in that header and defined once per build flavour: `fb/NimbleReader.cpp` for Buck, `BatchReaderOSS.cpp` for CMake. This is the same ODR-based split already used for `detail::defaultMetadata()` (`VeloxWriterDefaultMetadataOSS.cpp`) and `detail::initHook()` (`SelectiveNimbleReaderInitHookOSS.cpp`).
- `fb/NimbleReader.h` is deleted. With the factory gone it declared nothing, since the batch `NimbleReader` and `NimbleRowReader` live in an anonymous namespace in the `.cpp`.
- `fb/` keeps what is genuinely internal: the batch reader, the Iceberg field-id projection helpers, and `FieldIdResolver`.

In the open-source build the hook returns nullptr and the factory raises a clear error naming the session property, rather than failing to link. That path is unreachable in practice: `FileConfig::kSelectiveNimbleReaderEnabledSession` and `QueryConfig::kSelectiveNimbleReaderEnabled` both default to true, so every engine-driven read already takes the selective branch.

The 28 `#include` sites move to the new header. They have to change in this commit rather than a follow-up, because deleting the old header breaks them immediately.

On the CMake side, `nimble_velox_reader_factory` is a new library and `add_subdirectory(reader)` is ordered after `selective`, which it links. The new `NimbleReaderFactory.h` is listed in the `add_library()` source list because velox's `check-header-ownership` pre-commit hook requires every OSS-exported `.h` to be named by some `CMakeLists.txt` target.

Behavior of the reader path is unchanged on both branches; this is placement and linkage only.

Note for reviewers -- one unrelated build fix is folded in, at #ranklake's target. `mrs/ranklake/table_service/src/storage/table:nimble_index_tablet` is one of the consumers of the moved header, and it did not build on trunk. The cause is unrelated to this refactor: `829e31d97d31` ("[velox]refactor: Add IO stats setters to ReaderOptions and use pool-only constructor", May 9 2026) removed the multi-argument `ReaderOptions` constructor, and `d78602ee9fb1` ("[velox] Refactor ReaderOptions IoStatistics from raw pointers to shared_ptr", May 15 2026) moved the stats to `shared_ptr`, but this call site was never ported and has been broken for roughly three months. Verified pre-existing: the failing statement is byte-identical on master. It went unnoticed because the target is orphaned -- `tablet_factory` wires up `json_tablet`, `sst_tablet` and `base_tablet` but not `nimble_index_tablet`, and `buck2 uquery "rdeps(fbcode//mrs/..., ...)"` returns nothing, so nothing depends on it and it has no tests.

The port is mechanical:

```
-  facebook::velox::io::IoStatistics dataIoStats;
-  facebook::velox::io::IoStatistics metadataIoStats;
-  facebook::velox::dwio::common::ReaderOptions readerOpts{
-      pool.get(), &dataIoStats, &metadataIoStats};
+  auto dataIoStats = std::make_shared<facebook::velox::io::IoStatistics>();
+  auto metadataIoStats = std::make_shared<facebook::velox::io::IoStatistics>();
+  facebook::velox::dwio::common::ReaderOptions readerOpts{pool.get()};
+  readerOpts.setDataIoStats(dataIoStats).setMetadataIoStats(metadataIoStats);
```

This also closes a latent dangling-pointer bug: the old form handed raw pointers to two stack locals into `readerOpts`, which feeds `nimbleReader_`, a member that outlives the function. The `shared_ptr` form keeps them alive, which is what the velox change was for.

Once the file compiled, CLANGTIDY could run on it for the first time and flagged a pre-existing `unused parameter 'blobData'` in the `mergeTabletBlobData` stub; that parameter name is now commented out. Verification there is compile-only, since the target has no tests and no dependents.

Reviewed By: xiaoxmeng

Differential Revision: D114807828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant