[ODBC SCAN NODE] 1/4 Add unix odbc library. (#4377)

This commit is contained in:
HappenLee
2020-08-21 21:26:14 +08:00
committed by GitHub
parent 5976395bb6
commit a8fe54b7b9
5 changed files with 55 additions and 2 deletions

View File

@ -130,6 +130,9 @@ set_target_properties(glog PROPERTIES IMPORTED_LOCATION ${THIRDPARTY_DIR}/lib/li
add_library(re2 STATIC IMPORTED)
set_target_properties(re2 PROPERTIES IMPORTED_LOCATION ${THIRDPARTY_DIR}/lib/libre2.a)
add_library(odbc STATIC IMPORTED)
set_target_properties(odbc PROPERTIES IMPORTED_LOCATION ${THIRDPARTY_DIR}/lib/libodbc.a)
add_library(pprof STATIC IMPORTED)
set_target_properties(pprof PROPERTIES IMPORTED_LOCATION
${GPERFTOOLS_HOME}/lib/libprofiler.a)
@ -416,6 +419,7 @@ set(DORIS_DEPENDENCIES
arrow
parquet
orc
odbc
cctz
${WL_END_GROUP}
)
@ -462,7 +466,7 @@ else()
endif()
set(DORIS_LINK_LIBS ${DORIS_LINK_LIBS}
-lrt -lbfd -liberty -lc -lm -ldl -pthread
-lrt -lbfd -liberty -lc -lm -ldl -lltdl -pthread
)
# Set libraries for test

View File

@ -58,6 +58,7 @@ ADD_BE_TEST(es_predicate_test)
ADD_BE_TEST(es_query_builder_test)
ADD_BE_TEST(es_scan_reader_test)
#ADD_BE_TEST(schema_scan_node_test)
ADD_BE_TEST(unix_odbc_test)
#ADD_BE_TEST(schema_scanner_test)
##ADD_BE_TEST(set_executor_test)
#ADD_BE_TEST(schema_scanner/schema_authors_scanner_test)

View File

@ -0,0 +1,28 @@
// 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.
#include <sql.h>
int main(int argc, char* argv[]) {
SQLRETURN ret;
SQLHENV env;
/* Allocate an environment handle */
ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
return ret;
}

View File

@ -520,6 +520,19 @@ build_librdkafka() {
make -j$PARALLEL && make install
}
# libunixodbc
build_libunixodbc() {
check_if_source_exist $ODBC_SOURCE
cd $TP_SOURCE_DIR/$ODBC_SOURCE
CPPFLAGS="-I${TP_INCLUDE_DIR}" \
LDFLAGS="-L${TP_LIB_DIR}" \
CFLAGS="-fPIC" \
./configure --prefix=$TP_INSTALL_DIR --enable-static=yes
make -j$PARALLEL && make install
}
# flatbuffers
build_flatbuffers() {
check_if_source_exist $FLATBUFFERS_SOURCE
@ -692,6 +705,7 @@ build_cctz() {
# we just comment it, instead of remove it.
# build_llvm
build_libunixodbc
build_libevent
build_zlib
build_lz4

8
thirdparty/vars.sh vendored
View File

@ -188,6 +188,12 @@ BOOST_FOR_MYSQL_NAME=boost_1_59_0.tar.gz
BOOST_FOR_MYSQL_SOURCE=boost_1_59_0
BOOST_FOR_MYSQL_MD5SUM="51528a0e3b33d9e10aaa311d9eb451e3"
# unix odbc
ODBC_DOWNLOAD="http://www.unixodbc.org/unixODBC-2.3.7.tar.gz"
ODBC_NAME=unixODBC-2.3.7.tar.gz
ODBC_SOURCE=unixODBC-2.3.7
ODBC_MD5SUM="274a711b0c77394e052db6493840c6f9"
# leveldb
LEVELDB_DOWNLOAD="https://github.com/google/leveldb/archive/v1.20.tar.gz"
LEVELDB_NAME=leveldb-1.20.tar.gz
@ -278,5 +284,5 @@ CCTZ_SOURCE="cctz-2.3"
CCTZ_MD5SUM="209348e50b24dbbdec6d961059c2fc92"
# all thirdparties which need to be downloaded is set in array TP_ARCHIVES
export TP_ARCHIVES="LIBEVENT OPENSSL THRIFT LLVM CLANG COMPILER_RT PROTOBUF GFLAGS GLOG GTEST RAPIDJSON SNAPPY GPERFTOOLS ZLIB LZ4 BZIP LZO2 CURL RE2 BOOST MYSQL BOOST_FOR_MYSQL LEVELDB BRPC ROCKSDB LIBRDKAFKA FLATBUFFERS ARROW BROTLI DOUBLE_CONVERSION ZSTD S2 BITSHUFFLE CROARINGBITMAP ORC JEMALLOC CCTZ"
export TP_ARCHIVES="LIBEVENT OPENSSL THRIFT LLVM CLANG COMPILER_RT PROTOBUF GFLAGS GLOG GTEST RAPIDJSON SNAPPY GPERFTOOLS ZLIB LZ4 BZIP LZO2 CURL RE2 BOOST MYSQL BOOST_FOR_MYSQL ODBC LEVELDB BRPC ROCKSDB LIBRDKAFKA FLATBUFFERS ARROW BROTLI DOUBLE_CONVERSION ZSTD S2 BITSHUFFLE CROARINGBITMAP ORC JEMALLOC CCTZ"