From 137cb5c55a5fbf2ec58f9ebe825f32feae34addf Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Tue, 26 Dec 2023 15:52:39 +0800 Subject: [PATCH] [Cpp]: fix opendal debug build and delete fragment bug (#99) Signed-off-by: sunby --- cpp/cmake/libopendal.cmake | 3 ++- cpp/src/file/delete_fragment.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cpp/cmake/libopendal.cmake b/cpp/cmake/libopendal.cmake index 2040918..a21ab17 100644 --- a/cpp/cmake/libopendal.cmake +++ b/cpp/cmake/libopendal.cmake @@ -13,6 +13,7 @@ function(build_opendal) set(OPENDAL_BUILD_TYPE "debug") else() set(OPENDAL_BUILD_TYPE "release") + set(OPENDAL_BUILD_OPTS "--release") endif() ExternalProject_Add( @@ -22,7 +23,7 @@ function(build_opendal) PREFIX ${OPENDAL_PREFIX} SOURCE_SUBDIR bindings/c CONFIGURE_COMMAND echo "configure for opendal_ep" - BUILD_COMMAND cargo build --${OPENDAL_BUILD_TYPE} + BUILD_COMMAND cargo build ${OPENDAL_BUILD_OPTS} BUILD_IN_SOURCE 1 INSTALL_COMMAND bash -c "cp ${OPENDAL_PREFIX}/src/opendal_ep/target/${OPENDAL_BUILD_TYPE}/${OPENDAL_NAME} ${OPENDAL_PREFIX}/lib/ && cp ${OPENDAL_PREFIX}/src/opendal_ep/bindings/c/include/opendal.h ${OPENDAL_PREFIX}/include/") diff --git a/cpp/src/file/delete_fragment.cpp b/cpp/src/file/delete_fragment.cpp index bfffbfc..aac002b 100644 --- a/cpp/src/file/delete_fragment.cpp +++ b/cpp/src/file/delete_fragment.cpp @@ -1,11 +1,11 @@ // Copyright 2023 Zilliz -// +// // Licensed 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. @@ -46,7 +46,7 @@ Status DeleteFragment::Add(std::shared_ptr batch) { Result DeleteFragment::Make(std::shared_ptr fs, std::shared_ptr schema, const Fragment& fragment) { - DeleteFragment delete_fragment; + DeleteFragment delete_fragment(fs, schema, fragment.id()); auto opts = std::make_shared(); opts->columns = schema->delete_schema()->field_names();