github.com/dolthub/dolt/go@v0.40.5-0.20240520175717-68db7794bea6/performance/import_tester/run_importer.sh (about)

     1  #!/bin/bash
     2  
     3  WD=$(pwd)
     4  
     5  # Clone and checkout to release 0.34.5 which has the old version of import.
     6  # Add check if for directory exists
     7  if ! [ -d "$WD/dolt" ]; then
     8    git clone git@github.com:dolthub/dolt.git
     9    cd dolt/go
    10    git checkout tags/v0.34.5
    11  fi
    12  
    13  # Build that binary and store locally if hasn't been built already.
    14  if ! [ -f "$WD/old-dolt" ]; then
    15    cd $WD/dolt/go
    16    go build -o $WD/old-dolt "./cmd/dolt/"
    17  fi
    18  
    19  # Generate the test file
    20  cd $WD
    21  echo "generating test file"
    22  python3 csv_gen.py '{
    23      "cols": [
    24          {"name":"pk", "type":"int", "generator":"shuffled_sequential"},
    25          {"name":"c1", "type":"uuid"},
    26          {"name":"c2", "type":"string", "length":512},
    27          {"name":"c3", "type":"float"},
    28          {"name":"c4", "type":"int"}
    29      ],
    30      "row_count": 10000000
    31  }' > benchmark.csv
    32  
    33  # Run the current version of dolt
    34  echo "Running the current version of import"
    35  rm -rf .dolt
    36  dolt init
    37  time dolt table import -c --pk=pk current_version benchmark.csv
    38  
    39  # Run the current version of export
    40  echo "Running the current version of export"
    41  time dolt table export -f current_version export.csv
    42  
    43  # Run the old version of dolt
    44  rm -rf .dolt
    45  ./old-dolt init
    46  echo "Running version 0.34.5"
    47  time ./old-dolt table import -c --pk=pk old_version benchmark.csv
    48  
    49  # Run the old version of export
    50  time ./old-dolt table export -f old_version export.csv