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

[GitHub] [doris] yiguolei commented on a diff in pull request #11009: [tools] add clickbench tools

yiguolei commented on code in PR #11009:
URL: https://github.com/apache/doris/pull/11009#discussion_r924343995


##########
tools/clickbench-tools/load-clickbench-data.sh:
##########
@@ -0,0 +1,154 @@
+#!/usr/bin/env bash
+# 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.
+
+##############################################################
+# This script is used to load clickbench data into Doris
+##############################################################
+
+set -eo pipefail
+
+ROOT=$(dirname "$0")
+ROOT=$(
+    cd "$ROOT"
+    pwd
+)
+
+CURDIR=${ROOT}
+DATA_DIR=$CURDIR/ssb-data/
+DATA_DIR=/mnt/disk1/stephen
+
+usage() {
+    echo "
+Usage: $0 <options>
+  Optional options:
+     -c             parallelism to load data of lineorder table, default is 5.
+
+  Eg.
+    $0              load data using default value.
+    $0 -c 10        load lineorder table data using parallelism 10.     
+  "
+    exit 1
+}
+
+OPTS=$(getopt \
+    -n $0 \
+    -o '' \
+    -o 'hc:' \
+    -- "$@")
+
+eval set -- "$OPTS"
+
+PARALLEL=5
+HELP=0
+
+if [ $# == 0 ]; then
+    usage
+fi
+
+while true; do
+    case "$1" in
+    -h)
+        HELP=1
+        shift
+        ;;
+    -c)
+        PARALLEL=$2
+        shift 2
+        ;;
+    --)
+        shift
+        break
+        ;;
+    *)
+        echo "Internal error"
+        exit 1
+        ;;
+    esac
+done
+
+if [[ ${HELP} -eq 1 ]]; then
+    usage
+    exit
+fi
+
+check_prerequest() {
+    local CMD=$1
+    local NAME=$2
+    if ! $CMD; then
+        echo "$NAME is missing. This script depends on cURL to load data to Doris."
+        exit 1
+    fi
+}
+
+check_prerequest "mysql --version" "mysql"
+check_prerequest "curl --version" "curl"
+check_prerequest "wget --version" "wget"
+
+source $CURDIR/conf/doris-cluster.conf
+
+echo "FE_HOST: $FE_HOST"
+echo "FE_HTTP_PORT: $FE_HTTP_PORT"
+echo "USER: $USER"
+echo "PASSWORD: $PASSWORD"
+echo "DB: $DB"
+
+function check_doirs_conf() {
+    echo "check if Doris FE's and BE's conf"
+    exit_flag=false
+
+    cv=$(mysql -h$FE_HOST -P$FE_QUERY_PORT -u$USER -e 'admin show frontend config' | grep 'stream_load_default_timeout_second' | awk '{print $2}')
+    if (($cv < 3600)); then
+        echo "please revise your Doris FE's conf to set 'stream_load_default_timeout_second=3600' or above"
+        exit_flag=true
+    fi
+
+    cv=$(curl "${BE_HOST}:${BE_WEBSERVER_PORT}/varz" | grep 'streaming_load_max_mb' | awk -F'=' '{print $2}')
+    if (($cv < 16000)); then
+        echo -e "please revise your Doris BE's conf to set 'streaming_load_max_mb=16000' or above \noptional: 'flush_thread_num_per_store=5' to speed up load."
+        exit_flag=true
+    fi
+
+    if ${exit_flag}; then exit 1; fi
+}
+
+function load() {
+    echo "(1/2) prepare clickbench data file"
+    if [ ! -f $DATA_DIR/hits.tsv.gz ]; then
+        echo "can not find data file in local, will download it"
+        if [ ! -d $DATA_DIR ]; then mkdir -p $DATA_DIR; fi
+        cd $DATA_DIR && wget --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz' && cd -

Review Comment:
   把这个放到我们自己的COS 上吧,要不下载太慢了



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org