martin-g commented on code in PR #19244:
URL: https://github.com/apache/datafusion/pull/19244#discussion_r2606733035


##########
benchmarks/bench.sh:
##########
@@ -631,20 +631,22 @@ data_tpch() {
 
 # Points to TPCDS data generation instructions
 data_tpcds() {
-    TPCDS_DIR="${DATA_DIR}"
-
-    # Check if TPCDS data directory exists
-    if [ ! -d "${TPCDS_DIR}" ]; then
-        echo ""
-        echo "For TPC-DS data generation, please clone the 
datafusion-benchmarks repository:"
-        echo "  git clone https://github.com/apache/datafusion-benchmarks";
-        echo ""
-        return 1
+    TPCDS_DIR="${DATA_DIR}/tpcds_sf1"

Review Comment:
   Move this to line 43 ?! 
   This way it will be defined once and reused by `data_tpcds()` and 
`run_tpcds()`.
   



##########
benchmarks/bench.sh:
##########
@@ -631,20 +631,22 @@ data_tpch() {
 
 # Points to TPCDS data generation instructions

Review Comment:
   The comment is obsolete. 
   The method does not point anymore, it actually downloads the repo.



##########
benchmarks/bench.sh:
##########
@@ -631,20 +631,22 @@ data_tpch() {
 
 # Points to TPCDS data generation instructions
 data_tpcds() {
-    TPCDS_DIR="${DATA_DIR}"
-
-    # Check if TPCDS data directory exists
-    if [ ! -d "${TPCDS_DIR}" ]; then
-        echo ""
-        echo "For TPC-DS data generation, please clone the 
datafusion-benchmarks repository:"
-        echo "  git clone https://github.com/apache/datafusion-benchmarks";
-        echo ""
-        return 1
+    TPCDS_DIR="${DATA_DIR}/tpcds_sf1"
+
+    # Check if `web_site.parquet` exists in the TPCDS data directory to verify 
data presence
+    echo "Checking TPC-DS data directory: ${TPCDS_DIR}"
+    if [ ! -f "${TPCDS_DIR}/web_site.parquet" ]; then

Review Comment:
   Extract a variable for `"${TPCDS_DIR}/web_site.parquet"` at line 44 ? And 
reuse it in `data_tpcds()` and `run_tpcds()`



##########
benchmarks/bench.sh:
##########
@@ -631,20 +631,22 @@ data_tpch() {
 
 # Points to TPCDS data generation instructions
 data_tpcds() {
-    TPCDS_DIR="${DATA_DIR}"
-
-    # Check if TPCDS data directory exists
-    if [ ! -d "${TPCDS_DIR}" ]; then
-        echo ""
-        echo "For TPC-DS data generation, please clone the 
datafusion-benchmarks repository:"
-        echo "  git clone https://github.com/apache/datafusion-benchmarks";
-        echo ""
-        return 1
+    TPCDS_DIR="${DATA_DIR}/tpcds_sf1"
+
+    # Check if `web_site.parquet` exists in the TPCDS data directory to verify 
data presence
+    echo "Checking TPC-DS data directory: ${TPCDS_DIR}"
+    if [ ! -f "${TPCDS_DIR}/web_site.parquet" ]; then
+        mkdir -p "${TPCDS_DIR}"
+        # Download the DataFusion benchmarks repository zip if it is not 
already downloaded
+        if [ ! -f "${DATA_DIR}/datafusion-benchmarks.zip" ]; then
+          echo "Downloading DataFusion benchmarks repository zip to: 
${DATA_DIR}/datafusion-benchmarks.zip"
+          wget -O "${DATA_DIR}/datafusion-benchmarks.zip" 
https://github.com/apache/datafusion-benchmarks/archive/refs/heads/main.zip

Review Comment:
   ```suggestion
             wget --timeout=30 --tries=3 -O 
"${DATA_DIR}/datafusion-benchmarks.zip" 
https://github.com/apache/datafusion-benchmarks/archive/refs/heads/main.zip
   ```



##########
benchmarks/bench.sh:
##########
@@ -631,20 +631,22 @@ data_tpch() {
 
 # Points to TPCDS data generation instructions
 data_tpcds() {
-    TPCDS_DIR="${DATA_DIR}"
-
-    # Check if TPCDS data directory exists
-    if [ ! -d "${TPCDS_DIR}" ]; then
-        echo ""
-        echo "For TPC-DS data generation, please clone the 
datafusion-benchmarks repository:"
-        echo "  git clone https://github.com/apache/datafusion-benchmarks";
-        echo ""
-        return 1
+    TPCDS_DIR="${DATA_DIR}/tpcds_sf1"
+
+    # Check if `web_site.parquet` exists in the TPCDS data directory to verify 
data presence
+    echo "Checking TPC-DS data directory: ${TPCDS_DIR}"
+    if [ ! -f "${TPCDS_DIR}/web_site.parquet" ]; then
+        mkdir -p "${TPCDS_DIR}"
+        # Download the DataFusion benchmarks repository zip if it is not 
already downloaded
+        if [ ! -f "${DATA_DIR}/datafusion-benchmarks.zip" ]; then
+          echo "Downloading DataFusion benchmarks repository zip to: 
${DATA_DIR}/datafusion-benchmarks.zip"
+          wget -O "${DATA_DIR}/datafusion-benchmarks.zip" 
https://github.com/apache/datafusion-benchmarks/archive/refs/heads/main.zip

Review Comment:
   nit: Using `git clone` + `git pull` has the benefit of fetching the latest 
version of the datafusion-benchmarks repo. Using wget+unzip may become stale at 
some point and will require deleting the $TPCDS_DIR folder manually.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to