Skip to content

Commit 9b9e7f7

Browse files
committed
release 1
1 parent ae45a84 commit 9b9e7f7

File tree

227 files changed

+123856
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

227 files changed

+123856
-1374
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM python:3.10.13-bullseye
2+
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
3+
RUN sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
4+
RUN apt update -y
5+
RUN apt install -y cmake
6+
7+
WORKDIR /tmp
8+
RUN curl https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz > openssl-1.0.2u.tar.gz
9+
RUN tar -xzf openssl-1.0.2u.tar.gz
10+
WORKDIR /tmp/openssl-1.0.2u
11+
ENV CFLAGS=-fPIC
12+
ENV CXXFLAGS=-std=gnu++11
13+
RUN ./config shared no-asm --prefix=/usr/local/openssl --openssldir=/usr/local/openssl
14+
RUN make -j
15+
RUN make install
16+
ENV OPENSSL_ROOT_DIR=/usr/local/openssl
17+
18+
WORKDIR /
19+
ENV CXXFLAGS="-std=gnu++11 -static-libgcc -static-libstdc++"
20+
ENV PATH="/opt/BullseyeCoverage/bin:$PATH"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/build/
22
/builds/
3+
/core/test/build/
34
/dist/
45
/*egg-info/
56
/wheelhouse/

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ message(STATUS "[pybind11 ${pybind11_VERSION}]")
7676

7777
# add src to pybind11 module
7878
aux_source_directory(core/src SRC)
79+
80+
# add thirdpartys to src
81+
aux_source_directory(core/thirdparty/abseil/src ABSL_SRC)
82+
list(APPEND SRC ${ABSL_SRC})
83+
84+
message("SRC: ${SRC}")
7985
pybind11_add_module(${MODULE_NAME} ${SRC})
8086

8187
# definitions
@@ -89,6 +95,7 @@ target_compile_definitions(${MODULE_NAME}
8995
# include-dirs
9096
include_directories(
9197
${CMAKE_CURRENT_SOURCE_DIR}/core/include
98+
${CMAKE_CURRENT_SOURCE_DIR}/core/thirdparty/abseil/include
9299
${OPENSSL_INCLUDE_DIR}
93100
${Python_INCLUDE_DIRS}
94101
)

core/include/ConstantFactory.h

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ConstantFactory{
129129

130130
Dictionary* createDictionary(DATA_TYPE keyInternalType, DATA_TYPE keyType, DATA_TYPE valueType){
131131
if (valueType > DT_STRING
132-
&& (valueType != DT_UUID && valueType != DT_IP && valueType != DT_INT128 && valueType!= DT_BLOB && valueType != DT_DATEHOUR && valueType != DT_DATEMINUTE)) {
132+
&& (valueType != DT_DATEHOUR && valueType != DT_DATEMINUTE && valueType!= DT_BLOB)) {
133133
valueType = DT_ANY;
134134
}
135135
if(valueType != DT_ANY){
@@ -140,23 +140,24 @@ class ConstantFactory{
140140
case DT_LONG : return new LongDictionary(keyType,valueType);
141141
case DT_FLOAT : return new FloatDictionary(valueType);
142142
case DT_DOUBLE : return new DoubleDictionary(valueType);
143-
case DT_INT128 :
144-
if (valueType == DT_INT128)
145-
return NULL;
146-
return new Int128Dictionary(keyType,valueType);
147-
case DT_STRING : return new StringDictionary(keyType,valueType);
148-
default : return NULL;
143+
case DT_INT128 : return new Int128Dictionary(keyType,valueType);
144+
case DT_STRING :
145+
case DT_BLOB : return new StringDictionary(keyType,valueType);
146+
default : throw RuntimeException("Not allowed to create Dictionary for the key type " + Util::getDataTypeString(keyType));
149147
}
150148
}
151149
else{
152150
switch(keyInternalType){
153151
case DT_CHAR :
154152
case DT_SHORT :
155153
case DT_INT : return new IntAnyDictionary(keyType);
154+
case DT_FLOAT: return new FloatAnyDictionary(keyType);
155+
case DT_DOUBLE: return new DoubleAnyDictionary(keyType);
156156
case DT_LONG : return new LongAnyDictionary(keyType);
157157
case DT_INT128 : return new Int128AnyDictionary(keyType);
158-
case DT_STRING : return new AnyDictionary();
159-
default : return NULL;
158+
case DT_STRING :
159+
case DT_BLOB : return new AnyDictionary();
160+
default : throw RuntimeException("Not allowed to create Dictionary for this key type " + Util::getDataTypeString(keyType));
160161
}
161162
}
162163
}
@@ -271,6 +272,7 @@ class ConstantFactory{
271272
Constant* createIPAddr(int extraParam){return new IPAddr();}
272273
Constant* createDecima32(int extraParam) { return new Decimal32(extraParam); }
273274
Constant* createDecima64(int extraParam) { return new Decimal64(extraParam); }
275+
Constant* createDecima128(int extraParam) { return new Decimal128(extraParam); }
274276

275277
Vector* createVoidVector(INDEX size, INDEX capacity, bool fastMode, int extraParam, void* data, void** dataSegment, int segmentSizeInBit, bool containNull){
276278
throw RuntimeException("Not allowed to create void vector");
@@ -497,6 +499,16 @@ class ConstantFactory{
497499
return NULL;
498500
}
499501

502+
Vector* createDecimal128Vector(INDEX size, INDEX capacity, bool fastMode, int extraParam, void* data, void** dataSegment, int segmentSizeInBit, bool containNull) {
503+
if (data == NULL && dataSegment == NULL) {
504+
allocate<wide_integer::int128>(size, capacity, fastMode, segmentSizeInBit, data, dataSegment);
505+
}
506+
if (data != NULL)
507+
return new FastDecimalVector<wide_integer::int128>(extraParam, size, capacity, (wide_integer::int128*)data, containNull);
508+
else
509+
return NULL;
510+
}
511+
500512
Vector* createBoolArrayVector(INDEX size, INDEX capacity, bool fastMode, int extraParam, void *data, void *pindex, void** dataSegment, int segmentSizeInBit, bool containNull) {
501513
// if(data == NULL && dataSegment == NULL){
502514
// allocate<char>(size, capacity, fastMode, segmentSizeInBit, data, dataSegment);
@@ -627,7 +639,10 @@ class ConstantFactory{
627639
return new FastArrayVector(size, capacity, (char*)data, containNull, DATA_TYPE(DT_DECIMAL64 + ARRAY_TYPE_BASE), (INDEX *)pindex, extraParam);
628640
}
629641

630-
642+
Vector* createDecimal128ArrayVector(INDEX size, INDEX capacity, bool fastMode, int extraParam, void* data, void *pindex, void** dataSegment, int segmentSizeInBit, bool containNull) {
643+
return new FastArrayVector(size, capacity, (char*)data, containNull, DATA_TYPE(DT_DECIMAL128 + ARRAY_TYPE_BASE), (INDEX *)pindex, extraParam);
644+
}
645+
631646
Vector* createVoidMatrix(int cols, int rows, int colCapacity, int extraParam, void* data, void** dataSegment, int segmentSizeInBit, bool containNull){
632647
throw RuntimeException("Not allowed to create a void matrix");
633648
}
@@ -808,6 +823,8 @@ class ConstantFactory{
808823
arrConstFactory[DT_IP]=&ConstantFactory::createIPAddr;
809824
arrConstFactory[DT_DECIMAL32] = &ConstantFactory::createDecima32;
810825
arrConstFactory[DT_DECIMAL64] = &ConstantFactory::createDecima64;
826+
arrConstFactory[DT_DECIMAL128] = &ConstantFactory::createDecima128;
827+
811828
arrConstFactory[DT_DICTIONARY]=NULL;
812829

813830
arrConstVectorFactory[DT_VOID]=&ConstantFactory::createVoidVector;
@@ -836,6 +853,8 @@ class ConstantFactory{
836853
arrConstVectorFactory[DT_IP]=&ConstantFactory::createIPAddrVector;
837854
arrConstVectorFactory[DT_DECIMAL32] = &ConstantFactory::createDecimal32Vector;
838855
arrConstVectorFactory[DT_DECIMAL64] = &ConstantFactory::createDecimal64Vector;
856+
arrConstVectorFactory[DT_DECIMAL128] = &ConstantFactory::createDecimal128Vector;
857+
839858
arrConstVectorFactory[DT_FUNCTIONDEF]=&ConstantFactory::createAnyVector;
840859
arrConstVectorFactory[DT_HANDLE]=&ConstantFactory::createAnyVector;
841860
arrConstVectorFactory[DT_ANY]=&ConstantFactory::createAnyVector;
@@ -867,6 +886,7 @@ class ConstantFactory{
867886
arrConstArrayVectorFactory[DT_IP] = &ConstantFactory::createIpArrayVector;
868887
arrConstArrayVectorFactory[DT_DECIMAL32] = &ConstantFactory::createDecimal32ArrayVector;
869888
arrConstArrayVectorFactory[DT_DECIMAL64] = &ConstantFactory::createDecimal64ArrayVector;
889+
arrConstArrayVectorFactory[DT_DECIMAL128] = &ConstantFactory::createDecimal128ArrayVector;
870890

871891
arrConstMatrixFactory[DT_VOID]=&ConstantFactory::createVoidMatrix;
872892
arrConstMatrixFactory[DT_BOOL]=&ConstantFactory::createBoolMatrix;
@@ -1047,7 +1067,6 @@ class ConstantFactory{
10471067
ConstantVectorFunc arrConstVectorFactory[TYPE_COUNT];
10481068
ConstantArrayVectorFunc arrConstArrayVectorFactory[TYPE_COUNT];
10491069
ConstantMatrixFunc arrConstMatrixFactory[TYPE_COUNT];
1050-
ConstantRptVectorFunc arrConstRptVectorFactory[TYPE_COUNT];
10511070
unordered_map<string,DATA_TYPE> typeMap_;
10521071
unordered_map<string,DATA_FORM> formMap_;
10531072
char arrTypeSymbol[TYPE_COUNT];

0 commit comments

Comments
 (0)