timsaucer commented on code in PR #13937:
URL: https://github.com/apache/datafusion/pull/13937#discussion_r1929605183


##########
datafusion/ffi/src/lib.rs:
##########
@@ -26,5 +26,14 @@ pub mod session_config;
 pub mod table_provider;
 pub mod table_source;
 
+/// Returns the major version of the FFI implementation. If the API evolves,
+/// we use the major version to identify compatibility over the unsafe
+/// boundary.
+pub extern "C" fn version() -> u64 {
+    let version_str = env!("CARGO_PKG_VERSION");
+    let version = semver::Version::parse(version_str).expect("Invalid version 
string");
+    version.major
+}

Review Comment:
   I'm adding an additional note in the description that this function call is 
intended to be used by projects that are exposing libraries over FFI. Since 
that may be done in a couple of different ways such as either dynamic linking 
of a library or jumping through python, it's up to the downstream users to make 
the calls to this function and see if they are compatible. Also, since it is 
possible that the FFI bindings do not evolve over some datafusion versions you 
may have a case where multiple versions are compatible and don't require the 
same major version.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to