ianmcook opened a new issue, #4630:
URL: https://github.com/apache/arrow-adbc/issues/4630

   ### What happened?
   
   The C# driver manager derives an entrypoint of `AdbcDriver{PascalCase}Init` 
from the driver library filename, but performs only that single symbol lookup. 
If the driver does not export that exact name, loading fails with 
`EntryPointNotFoundException` even though the driver exports the standard 
`AdbcDriverInit`.
   
   Compare this to the C/C++ driver manager which tries the derived name and 
then falls back to `AdbcDriverInit` (`c/driver_manager/adbc_driver_manager.cc`):
   
   ```cpp
   static const char kDefaultEntrypoint[] = "AdbcDriverInit";
   ...
   status = library.Lookup(name.c_str(), &load_handle, error);
   if (status != ADBC_STATUS_OK) {
     status = library.Lookup(kDefaultEntrypoint, &load_handle, error);
   }
   ```
   
   C# has no equivalent fallback, so drivers that load fine from Go/Python/R 
fail from C#:
   
   ```csharp
   // Manifest declares no entrypoint; C# derives "AdbcDriverClickhouseInit"
   using var driver = AdbcDriverManager.FindLoadDriver(
       "clickhouse", loadOptions: AdbcLoadFlags.Default);
   
   // System.EntryPointNotFoundException: Unable to find an entry point named
   // 'AdbcDriverClickhouseInit' in shared library.
   ```
   
   `nm -gU libadbc_driver_clickhouse.dylib | grep -iE 'init$'` shows the 
derived name is
   absent but the standard one is present:
   
   ```
   _AdbcClickhouseInit
   _AdbcDriverInit
   ```
   
   You can work around this by passing `entrypoint: "AdbcDriverInit"` in the 
client code.
   
   This problem affects the ClickHouse, Exasol, MySQL, and SingleStore drivers. 
We opened issues to solve this in the drivers, but we should solve it here too.
   
   ### Stack Trace
   
   _No response_
   
   ### How can we reproduce the bug?
   
   _No response_
   
   ### Environment/Setup
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to