diff --git a/Formula/datafusion.rb b/Formula/datafusion.rb new file mode 100644 index 0000000000000..1aba32fc4b7b4 --- /dev/null +++ b/Formula/datafusion.rb @@ -0,0 +1,19 @@ +class Datafusion < Formula + desc "Apache Arrow DataFusion and Ballista query engines" + homepage "https://arrow.apache.org/datafusion" + url "https://github.com/apache/arrow-datafusion/archive/refs/tags/5.0.0.tar.gz" + sha256 "7ba05bba8b7ea3b1f7ff6b3d1b1a3413a81540c57342ef331d51a07ad4a7b7a8" + license "Apache-2.0" + head "https://github.com/apache/arrow-datafusion.git", branch: "master" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args(path: "datafusion-cli") + end + + test do + (testpath/"datafusion_test.sql").write("select 1+2 as n;") + assert_equal "[{\"n\":3}]", shell_output("#{bin}/datafusion-cli -q --format json -f datafusion_test.sql").strip + end +end