From a02c475a0c3a5ee8fa3ee9e744ab7768b21d4d69 Mon Sep 17 00:00:00 2001 From: yokofly Date: Tue, 16 Jan 2024 23:28:47 -0800 Subject: [PATCH 1/4] fix typo: destory -> destroy https://word.tips/spelling/destroy-vs-destory/ --- src/Common/Streaming/Substream/ExecutorImpl.h | 4 ++-- src/Interpreters/Streaming/Aggregator.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Common/Streaming/Substream/ExecutorImpl.h b/src/Common/Streaming/Substream/ExecutorImpl.h index d774cb2df57..f5c7b8129ed 100644 --- a/src/Common/Streaming/Substream/ExecutorImpl.h +++ b/src/Common/Streaming/Substream/ExecutorImpl.h @@ -626,14 +626,14 @@ struct ExecutorImpl /// Return {removed, last_removed_watermark, remaining_size} template ... F> - void removeBucketsBefore(Int64 watermark, F &&... destory) + void removeBucketsBefore(Int64 watermark, F &&... destroy) { auto destroy_wrapper = [&](DataPtr & data) { if (nullptr == data) return; Data & data_ref = *reinterpret_cast(data); - (destory(data_ref), ...); + (destroy(data_ref), ...); data = nullptr; }; diff --git a/src/Interpreters/Streaming/Aggregator.cpp b/src/Interpreters/Streaming/Aggregator.cpp index a441687e964..bb0bab31b1e 100644 --- a/src/Interpreters/Streaming/Aggregator.cpp +++ b/src/Interpreters/Streaming/Aggregator.cpp @@ -2355,7 +2355,7 @@ void NO_INLINE Aggregator::mergeDataImpl( { /// If there are multiple sources, there are more than one AggregatedDataVariant. Aggregator always creates a new AggregatedDataVariant and merge all other /// AggregatedDataVariants to the new created one. After finalize(), it does not clean up aggregate state except the new create AggregatedDataVariant. - /// If it does not alloc new memory for the 'dst' (i.e. aggregate state of the new AggregatedDataVariant which get destoryed after finalize()) but reuse + /// If it does not alloc new memory for the 'dst' (i.e. aggregate state of the new AggregatedDataVariant which get destroyed after finalize()) but reuse /// that from the 'src' to store the final aggregated result, it will cause the data from other AggregatedDataVariant will be merged multiple times and /// generate incorrect aggregated result. dst = arena->alignedAlloc(total_size_of_aggregate_states, align_aggregate_states); From 11331f5cd3baf20a6e2e892742f57e9bd21492d4 Mon Sep 17 00:00:00 2001 From: yokofly Date: Wed, 17 Jan 2024 18:07:09 -0800 Subject: [PATCH 2/4] add sha256 in the binary output log homebrew proton require the version number and sha256sum https://github.com/timeplus-io/homebrew-timeplus/commit/1c8ef6ca4a74e576f13178482a98b1bf3eb85211 normally you have to download the binary to get the sha256 output , right now just check the releasebuild action workflow log. this commit wanna take: (minimal effort to relieve the way to upgrade homebrew) --- .github/workflows/release_build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 8dde0bf6c68..2bc82f675f7 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -226,6 +226,7 @@ jobs: PROTON_BINARY=proton-$PROTON_TAG-Darwin-x86_64 echo "Proton Binary Name: $PROTON_BINARY" + sha256sum $GITHUB_WORKSPACE/output/proton mv $GITHUB_WORKSPACE/output/proton $GITHUB_WORKSPACE/$PROTON_BINARY secrets: @@ -284,6 +285,7 @@ jobs: PROTON_BINARY=proton-$PROTON_TAG-Darwin-arm64 echo "Proton Binary Name: $PROTON_BINARY" + sha256sum $GITHUB_WORKSPACE/output/proton mv $GITHUB_WORKSPACE/output/proton $GITHUB_WORKSPACE/$PROTON_BINARY secrets: From dc3f5658193b04576fd3eaa2f69ad13e183705c3 Mon Sep 17 00:00:00 2001 From: yokofly Date: Thu, 18 Jan 2024 21:50:46 -0800 Subject: [PATCH 3/4] fix #501 --- install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index a1a5229794d..4954f9f7661 100644 --- a/install.sh +++ b/install.sh @@ -42,13 +42,17 @@ TARGET_FILE="proton" # Check if the proton file exists if [ -f "$TARGET_FILE" ]; then - echo -n "'proton' file exists. Do you want to overwrite it? (y/n): " - read REPLY - echo - if [ "$(echo $REPLY | cut -c1)" = "y" ] || [ "$(echo $REPLY | cut -c1)" = "Y" ]; then + read -p "'proton' file already exists. Do you want to overwrite it? (y/n): " answer + if [ "$answer" = "y" -o "$answer" = "Y" ]; then TARGET_FILE="proton" else TARGET_FILE=$BINARY_FILE + i=0 + while [ -f "$BINARY_FILE" ] + do + BINARY_FILE="${BINARY_FILE}.${i}" + i=$(($i+1)) + done fi fi @@ -79,6 +83,7 @@ For detailed usage and more information, check out the Timeplus documentation: https://docs.timeplus.com/" else echo "Download failed or the binary for $OS-$ARCH is not available." >&2 + exit 1 fi if [ "${OS}" = "Linux" ] From 56e837f6e708b497e450791ef349fe57a2e6f662 Mon Sep 17 00:00:00 2001 From: yokofly Date: Thu, 18 Jan 2024 22:02:53 -0800 Subject: [PATCH 4/4] continue improve bash script --- install.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 4954f9f7661..307c2547050 100644 --- a/install.sh +++ b/install.sh @@ -41,18 +41,19 @@ BINARY_FILE="proton-${LATEST_TAG}-${OS}-${ARCH}" TARGET_FILE="proton" # Check if the proton file exists + +# Fix me, what if I wanna use this script 3 times? +# if `proton` not exist, we use proton +# else +# 1.use `"proton-${LATEST_TAG}-${OS}-${ARCH}"` (by default) +# 2.overwrite it(only work on manual bash install.sh) + if [ -f "$TARGET_FILE" ]; then read -p "'proton' file already exists. Do you want to overwrite it? (y/n): " answer if [ "$answer" = "y" -o "$answer" = "Y" ]; then TARGET_FILE="proton" else TARGET_FILE=$BINARY_FILE - i=0 - while [ -f "$BINARY_FILE" ] - do - BINARY_FILE="${BINARY_FILE}.${i}" - i=$(($i+1)) - done fi fi