-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(parquet): Add support for weak functions to register parquet readers and writers #11882
base: main
Are you sure you want to change the base?
Conversation
…der/writers Summary: This diff marks the registerParquet*factory functions with the weak attribute. The weak attribute allows the linker to discard the weaker implementation of the registerParquet*factory functions and in place use the stronger one (See: https://en.wikipedia.org/wiki/Weak_symbol). This should remove the need to compile the same files with different options, leading to ODRs when both targets are added as dependencies to the same binary. Differential Revision: D67301778
This pull request was exported from Phabricator. Differential Revision: D67301778 |
✅ Deploy Preview for meta-velox canceled.
|
cc: @majetideepak Some code cleanup so internally we dont have ODR violations. |
@kgpai The same Wikipedia article mentions |
|
This happens internally - Not sure if you recall but we had to create two targets one with VELOX_ENABLE_PARQUET defined and one without it . The one with it defined is only used for tests and the other is used everywhere else where we have the registration code. This is problematic with our internal tools like automated linters which do not use the right dependency many times causing folks to link against the PARQUET enabled target and see linking errors or at worst runtime errors. |
Summary:
This diff marks the registerParquetfactory functions with the weak attribute. The weak attribute allows the linker to discard the weaker implementation of the registerParquetfactory functions and in place use the stronger one (See: https://en.wikipedia.org/wiki/Weak_symbol).
This should remove the need to compile the same files with different options, leading to ODRs when both targets are added as dependencies to the same binary.
Differential Revision: D67301778