You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/12 15:19:27 UTC

[GitHub] [arrow-datafusion] andygrove opened a new pull request, #2881: Add h2o bench groupby queries

andygrove opened a new pull request, #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes https://github.com/apache/arrow-datafusion/issues/2879
   
    # Rationale for this change
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   I would like to make it easier to run h20 benchmarks
   
   # What changes are included in this PR?
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Add h20 benchmark
   
   # Are there any user-facing changes?
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   No
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove merged pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
andygrove merged PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#issuecomment-1181941329

   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2881](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d6817fc) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/d0d5564b8f689a01e542b8c1df829d74d0fab2b0?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d0d5564) will **decrease** coverage by `0.05%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head d6817fc differs from pull request most recent head 72d7816. Consider uploading reports for the commit 72d7816 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #2881      +/-   ##
   ==========================================
   - Coverage   85.25%   85.19%   -0.06%     
   ==========================================
     Files         275      276       +1     
     Lines       49010    49040      +30     
   ==========================================
   - Hits        41782    41781       -1     
   - Misses       7228     7259      +31     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [benchmarks/src/bin/h2o.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/2881/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YmVuY2htYXJrcy9zcmMvYmluL2gyby5ycw==) | `0.00% <0.00%> (ø)` | |
   | [datafusion/expr/src/window\_frame.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/2881/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi9leHByL3NyYy93aW5kb3dfZnJhbWUucnM=) | `92.43% <0.00%> (-0.85%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d0d5564...72d7816](https://codecov.io/gh/apache/arrow-datafusion/pull/2881?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#discussion_r919602051


##########
benchmarks/src/bin/h2o.rs:
##########
@@ -0,0 +1,92 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! DataFusion h2o benchmarks
+
+use datafusion::{
+    arrow::util::pretty,
+    error::Result,
+    prelude::{CsvReadOptions, SessionContext},
+};
+use std::path::PathBuf;
+use structopt::StructOpt;
+use tokio::time::Instant;
+
+#[derive(Debug, StructOpt)]
+#[structopt(name = "datafusion-h2o", about = "DataFusion h2o benchmarks")]
+enum Opt {
+    GroupBy(GroupBy), //TODO add Join queries
+}
+
+#[derive(Debug, StructOpt)]
+struct GroupBy {
+    /// Query number
+    #[structopt(short, long)]
+    query: usize,
+    /// Path to data file
+    #[structopt(parse(from_os_str), required = true, short = "p", long = "path")]
+    path: PathBuf,
+    /// Activate debug mode to see query results
+    #[structopt(short, long)]
+    debug: bool,
+}
+
+#[tokio::main]
+async fn main() -> Result<()> {
+    let opt = Opt::from_args();
+    println!("Running benchmarks with the following options: {:?}", opt);
+    match opt {
+        Opt::GroupBy(config) => group_by(&config).await,
+    }
+}
+
+async fn group_by(config: &GroupBy) -> Result<()> {
+    let start = Instant::now();
+    let path = config.path.to_str().unwrap();
+    let ctx = SessionContext::new();
+    ctx.register_csv("x", path, CsvReadOptions::default())

Review Comment:
   Wow, the results were already looking pretty great but that would be even better, Do you have a link to where they mention this?



-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove commented on pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#issuecomment-1183637189

   ## Reading from CSV
   
   ```
   $ ../target/release/h2o group-by --query 1 --path /mnt/bigdata/h2oai/N_1e7_K_1e2_single.csv
   Running benchmarks with the following options: GroupBy(GroupBy { query: 1, path: "/mnt/bigdata/h2oai/N_1e7_K_1e2_single.csv", debug: false, mem_table: false })
   Executing select id1, sum(v1) as v1 from x group by id1
   h2o groupby query 1 took 1793 ms
   ```
   
   ## Reading from memory
   
   ```
   $ ../target/release/h2o group-by --query 1 --path /mnt/bigdata/h2oai/N_1e7_K_1e2_single.csv --mem-table
   Running benchmarks with the following options: GroupBy(GroupBy { query: 1, path: "/mnt/bigdata/h2oai/N_1e7_K_1e2_single.csv", debug: false, mem_table: true })
   Executing select id1, sum(v1) as v1 from x group by id1
   h2o groupby query 1 took 396 ms
   ```
   


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] ursabot commented on pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#issuecomment-1183675155

   Benchmark runs are scheduled for baseline = fd64e6f2e5ca5ba8c33c431b75a3ba9441091970 and contender = 6dc9dea30e496ad1c9880913abd73a90b6070fb2. 6dc9dea30e496ad1c9880913abd73a90b6070fb2 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/49a1d1abe7a04661a48bcd36c95c6e49...57d2d9dd251e4feeb52f88f3ccc14c65/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/e3463576e89146839bd68e18095a44d7...dd9c55dafeca4d9daff66982e5595b52/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/4955ee341d9742af8d0a642577840bbb...8eb49a162f6c44ae91279fea310b21b2/)
   [Skipped :warning: Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/18cb97ee277742dd9590f5a48d15539c...5658d21e7acd4a3594036eb65b2293ae/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#discussion_r919606784


##########
benchmarks/src/bin/h2o.rs:
##########
@@ -0,0 +1,92 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! DataFusion h2o benchmarks
+
+use datafusion::{
+    arrow::util::pretty,
+    error::Result,
+    prelude::{CsvReadOptions, SessionContext},
+};
+use std::path::PathBuf;
+use structopt::StructOpt;
+use tokio::time::Instant;
+
+#[derive(Debug, StructOpt)]
+#[structopt(name = "datafusion-h2o", about = "DataFusion h2o benchmarks")]
+enum Opt {
+    GroupBy(GroupBy), //TODO add Join queries
+}
+
+#[derive(Debug, StructOpt)]
+struct GroupBy {
+    /// Query number
+    #[structopt(short, long)]
+    query: usize,
+    /// Path to data file
+    #[structopt(parse(from_os_str), required = true, short = "p", long = "path")]
+    path: PathBuf,
+    /// Activate debug mode to see query results
+    #[structopt(short, long)]
+    debug: bool,
+}
+
+#[tokio::main]
+async fn main() -> Result<()> {
+    let opt = Opt::from_args();
+    println!("Running benchmarks with the following options: {:?}", opt);
+    match opt {
+        Opt::GroupBy(config) => group_by(&config).await,
+    }
+}
+
+async fn group_by(config: &GroupBy) -> Result<()> {
+    let start = Instant::now();
+    let path = config.path.to_str().unwrap();
+    let ctx = SessionContext::new();
+    ctx.register_csv("x", path, CsvReadOptions::default())

Review Comment:
   nm, I see it now
   
   ```
   Solutions are using in-memory data storage to achieve best timing.
   ```



-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
Dandandan commented on code in PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#discussion_r919945755


##########
benchmarks/src/bin/h2o.rs:
##########
@@ -0,0 +1,92 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! DataFusion h2o benchmarks
+
+use datafusion::{
+    arrow::util::pretty,
+    error::Result,
+    prelude::{CsvReadOptions, SessionContext},
+};
+use std::path::PathBuf;
+use structopt::StructOpt;
+use tokio::time::Instant;
+
+#[derive(Debug, StructOpt)]
+#[structopt(name = "datafusion-h2o", about = "DataFusion h2o benchmarks")]
+enum Opt {
+    GroupBy(GroupBy), //TODO add Join queries
+}
+
+#[derive(Debug, StructOpt)]
+struct GroupBy {
+    /// Query number
+    #[structopt(short, long)]
+    query: usize,
+    /// Path to data file
+    #[structopt(parse(from_os_str), required = true, short = "p", long = "path")]
+    path: PathBuf,
+    /// Activate debug mode to see query results
+    #[structopt(short, long)]
+    debug: bool,
+}
+
+#[tokio::main]
+async fn main() -> Result<()> {
+    let opt = Opt::from_args();
+    println!("Running benchmarks with the following options: {:?}", opt);
+    match opt {
+        Opt::GroupBy(config) => group_by(&config).await,
+    }
+}
+
+async fn group_by(config: &GroupBy) -> Result<()> {
+    let start = Instant::now();
+    let path = config.path.to_str().unwrap();
+    let ctx = SessionContext::new();
+    ctx.register_csv("x", path, CsvReadOptions::default())

Review Comment:
   Glad you found it. Some solutions also use specific (such as dictionary) encoding to get better results and lower memory usage.
   
   The old PR for the rust solution is here:
   https://github.com/h2oai/db-benchmark/pull/182
   
   This also includes some performance tweaks like changing the allocator, compile flags, prepartioning and batch size.
   
   
   
   



-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
Dandandan commented on code in PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#discussion_r919429668


##########
benchmarks/src/bin/h2o.rs:
##########
@@ -0,0 +1,92 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! DataFusion h2o benchmarks
+
+use datafusion::{
+    arrow::util::pretty,
+    error::Result,
+    prelude::{CsvReadOptions, SessionContext},
+};
+use std::path::PathBuf;
+use structopt::StructOpt;
+use tokio::time::Instant;
+
+#[derive(Debug, StructOpt)]
+#[structopt(name = "datafusion-h2o", about = "DataFusion h2o benchmarks")]
+enum Opt {
+    GroupBy(GroupBy), //TODO add Join queries
+}
+
+#[derive(Debug, StructOpt)]
+struct GroupBy {
+    /// Query number
+    #[structopt(short, long)]
+    query: usize,
+    /// Path to data file
+    #[structopt(parse(from_os_str), required = true, short = "p", long = "path")]
+    path: PathBuf,
+    /// Activate debug mode to see query results
+    #[structopt(short, long)]
+    debug: bool,
+}
+
+#[tokio::main]
+async fn main() -> Result<()> {
+    let opt = Opt::from_args();
+    println!("Running benchmarks with the following options: {:?}", opt);
+    match opt {
+        Opt::GroupBy(config) => group_by(&config).await,
+    }
+}
+
+async fn group_by(config: &GroupBy) -> Result<()> {
+    let start = Instant::now();
+    let path = config.path.to_str().unwrap();
+    let ctx = SessionContext::new();
+    ctx.register_csv("x", path, CsvReadOptions::default())

Review Comment:
   The h2o abenchmark allows to read the data into memory (otherwise it would be mostly measuring the csv parser).



-- 
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-unsubscribe@arrow.apache.org

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


[GitHub] [arrow-datafusion] andygrove commented on pull request #2881: Add h2o bench groupby queries

Posted by GitBox <gi...@apache.org>.
andygrove commented on PR #2881:
URL: https://github.com/apache/arrow-datafusion/pull/2881#issuecomment-1183637755

   @Dandandan This is ready for another review


-- 
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-unsubscribe@arrow.apache.org

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