Skip to content

Commit

Permalink
Merge branch 'main' into duck_stl_allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Sep 5, 2024
2 parents 988f3ca + a6e32b1 commit cac5a82
Show file tree
Hide file tree
Showing 55 changed files with 842 additions and 558 deletions.
1 change: 1 addition & 0 deletions .github/workflows/LinuxRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- uses: ./.github/actions/manylinux_2014_setup
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ if(${EXPLICIT_EXCEPTIONS})
set(CXX_EXTRA "${CXX_EXTRA} -fexceptions")
endif()

if (UNSAFE_NUMERIC_CAST)
message(status "UNSAFE_NUMERIC_CAST")
add_definitions(-DUNSAFE_NUMERIC_CAST=1)
endif()
if (ENABLE_EXTENSION_AUTOLOADING)
add_definitions(-DDUCKDB_EXTENSION_AUTOLOAD_DEFAULT=1)
endif()
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ endif
ifneq (${ENABLE_EXTENSION_AUTOINSTALL}, "")
CMAKE_VARS:=${CMAKE_VARS} -DENABLE_EXTENSION_AUTOINSTALL=${ENABLE_EXTENSION_AUTOINSTALL}
endif
ifneq (${UNSAFE_NUMERIC_CAST}, "")
ifneq (${UNSAFE_NUMERIC_CAST}, )
CMAKE_VARS:=${CMAKE_VARS} -DUNSAFE_NUMERIC_CAST=1
endif
ifeq (${BUILD_EXTENSIONS_ONLY}, 1)
Expand Down
10 changes: 10 additions & 0 deletions src/common/arrow/arrow_appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ static void InitializeFunctionPointers(ArrowAppendData &append_data, const Logic
InitializeAppenderForType<ArrowScalarData<int64_t>>(append_data);
break;
case LogicalTypeId::UUID:
if (append_data.options.arrow_lossless_conversion) {
InitializeAppenderForType<ArrowScalarData<hugeint_t, hugeint_t, ArrowUUIDBlobConverter>>(append_data);
} else {
if (append_data.options.arrow_offset_size == ArrowOffsetSize::LARGE) {
InitializeAppenderForType<ArrowVarcharData<hugeint_t, ArrowUUIDConverter>>(append_data);
} else {
InitializeAppenderForType<ArrowVarcharData<hugeint_t, ArrowUUIDConverter, int32_t>>(append_data);
}
}
break;
case LogicalTypeId::HUGEINT:
InitializeAppenderForType<ArrowScalarData<hugeint_t>>(append_data);
break;
Expand Down
22 changes: 17 additions & 5 deletions src/common/arrow/arrow_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,23 @@ void SetArrowFormat(DuckDBArrowSchemaHolder &root_holder, ArrowSchema &child, co
child.format = "g";
break;
case LogicalTypeId::UUID: {
// This is a canonical extension, hence needs the "arrow." prefix
child.format = "w:16";
auto schema_metadata = ArrowSchemaMetadata::MetadataFromName("arrow.uuid");
root_holder.metadata_info.emplace_back(schema_metadata.SerializeMetadata());
child.metadata = root_holder.metadata_info.back().get();
if (options.arrow_lossless_conversion) {
// This is a canonical extension, hence needs the "arrow." prefix
child.format = "w:16";
auto schema_metadata = ArrowSchemaMetadata::MetadataFromName("arrow.uuid");
root_holder.metadata_info.emplace_back(schema_metadata.SerializeMetadata());
child.metadata = root_holder.metadata_info.back().get();
} else {
if (options.produce_arrow_string_view) {
child.format = "vu";
} else {
if (options.arrow_offset_size == ArrowOffsetSize::LARGE) {
child.format = "U";
} else {
child.format = "u";
}
}
}
break;
}
case LogicalTypeId::VARCHAR:
Expand Down
10 changes: 8 additions & 2 deletions src/core_functions/function_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ static const StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION_SET(BitwiseAndFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ListHasAnyFunAlias),
DUCKDB_SCALAR_FUNCTION(PowOperatorFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListInnerProductFunAlias),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListNegativeInnerProductFunAlias),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListDistanceFunAlias),
DUCKDB_SCALAR_FUNCTION_SET(LeftShiftFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListCosineSimilarityFunAlias),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListCosineDistanceFunAlias),
DUCKDB_SCALAR_FUNCTION_ALIAS(ListHasAllFunAlias2),
DUCKDB_SCALAR_FUNCTION_SET(RightShiftFun),
DUCKDB_SCALAR_FUNCTION_SET(AbsOperatorFun),
Expand All @@ -82,6 +82,7 @@ static const StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayAggrFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayAggregateFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayApplyFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayCosineDistanceFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayCosineSimilarityFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayCrossProductFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayDistanceFun),
Expand All @@ -92,6 +93,8 @@ static const StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayHasAllFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayHasAnyFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayInnerProductFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ArrayNegativeDotProductFun),
DUCKDB_SCALAR_FUNCTION_SET(ArrayNegativeInnerProductFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayReduceFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ArrayReverseSortFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ArraySliceFun),
Expand Down Expand Up @@ -230,6 +233,7 @@ static const StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION_ALIAS(ListAggrFun),
DUCKDB_SCALAR_FUNCTION(ListAggregateFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ListApplyFun),
DUCKDB_SCALAR_FUNCTION_SET(ListCosineDistanceFun),
DUCKDB_SCALAR_FUNCTION_SET(ListCosineSimilarityFun),
DUCKDB_SCALAR_FUNCTION_SET(ListDistanceFun),
DUCKDB_SCALAR_FUNCTION(ListDistinctFun),
Expand All @@ -239,6 +243,8 @@ static const StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION(ListHasAllFun),
DUCKDB_SCALAR_FUNCTION(ListHasAnyFun),
DUCKDB_SCALAR_FUNCTION_SET(ListInnerProductFun),
DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ListNegativeDotProductFun),
DUCKDB_SCALAR_FUNCTION_SET(ListNegativeInnerProductFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(ListPackFun),
DUCKDB_SCALAR_FUNCTION(ListReduceFun),
DUCKDB_SCALAR_FUNCTION_SET(ListReverseSortFun),
Expand Down
Loading

0 comments on commit cac5a82

Please sign in to comment.