如何将 Apache Arrow 的 Datafusion 1.0.0-SNAPSHOT 用作 Cargo 项目的依赖项?

How to use Apache Arrow's Datafusion 1.0.0-SNAPSHOT as a dependency in a Cargo project?

在 Datafusion 的 git repository 上,它说将以下内容添加到 Cargo.toml 文件以将其用作库:

[dependencies]
datafusion = "1.0.0-SNAPSHOT"

我在 运行 cargo build

时将其作为输出
 Updating crates.io index
error: failed to select a version for the requirement `datafusion = "^1.0.0-SNAPSHOT"`
  candidate versions found which didn't match: 0.17.0, 0.16.0, 0.15.1, ...
  location searched: crates.io index
required by package `hello_cargo v0.1.0 (/Users/jay/Projects/hello_cargo)`

然后我尝试使用 0.17.0 和 运行 cargo +nightly build:

error: failed to run custom build command for `arrow-flight v0.17.0`

    Caused by:
      process didn't exit successfully: `/Users/jay/Projects/hello_cargo/target/debug/build/arrow-flight-46000fbc5b8b474b/build-script-build` (exit code: 1)
    --- stderr
    Error: "Failed to locate format/Flight.proto in any parent directory"
    
    warning: build failed, waiting for other jobs to finish...
    error: build failed

当我使用版本 0.16.0 时似乎可以工作

正如 Cargo 告诉您的那样:

candidate versions found which didn't match: 0.17.0, 0.16.0, 0.15.1, ...

此 crate 没有名为 1.0.0-SNAPSHOT 的版本发布到 crates.io。如果你想使用来自 git 存储库的未发布代码,你需要 use a git dependency:

[dependencies]
rand = { git = "https://github.com/apache/arrow/" }

另请参阅: