Skip to content

Commit

Permalink
merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Jul 19, 2023
2 parents 2258516 + 9b0a635 commit 21b61c4
Show file tree
Hide file tree
Showing 27 changed files with 2,237 additions and 1,403 deletions.
1 change: 1 addition & 0 deletions .github/config/uncovered_files.csv
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ execution/physical_plan/plan_show_select.cpp 3
execution/physical_plan_generator.cpp 6
execution/radix_partitioned_hashtable.cpp 3
execution/reservoir_sample.cpp 60
execution/window_executor.cpp 29
execution/window_segment_tree.cpp 12
function/aggregate/sorted_aggregate_function.cpp 85
function/built_in_functions.cpp 6
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/NightlyTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ concurrency:

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DUCKDB_WASM_VERSION: "a8f2c38"
DUCKDB_WASM_VERSION: "687bab9a"
CCACHE_SAVE: ${{ github.repository != 'duckdb/duckdb' }}

jobs:
Expand Down Expand Up @@ -696,6 +696,7 @@ jobs:
git clone --recurse-submodules https://github.com/duckdb/duckdb-wasm
cd duckdb-wasm
git checkout ${{ env.DUCKDB_WASM_VERSION }}
git submodule update
shopt -s nullglob
for filename in ../.github/patches/duckdb-wasm/*.patch; do
git apply $filename
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json

aggregate_functions = ['algebraic', 'distributive', 'holistic', 'nested', 'regression']
scalar_functions = ['bit', 'blob', 'date', 'enum', 'generic', 'list', 'map', 'math', 'operators', 'random', 'string', 'struct', 'union']
scalar_functions = ['bit', 'blob', 'date', 'enum', 'generic', 'list', 'map', 'math', 'operators', 'random', 'string', 'debug', 'struct', 'union']

header = '''//===----------------------------------------------------------------------===//
// DuckDB
Expand Down
2 changes: 2 additions & 0 deletions src/core_functions/function_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "duckdb/core_functions/scalar/string_functions.hpp"
#include "duckdb/core_functions/scalar/struct_functions.hpp"
#include "duckdb/core_functions/scalar/union_functions.hpp"
#include "duckdb/core_functions/scalar/debug_functions.hpp"

namespace duckdb {

Expand Down Expand Up @@ -339,6 +340,7 @@ static StaticFunctionDefinition internal_functions[] = {
DUCKDB_AGGREGATE_FUNCTION(VarPopFun),
DUCKDB_AGGREGATE_FUNCTION(VarSampFun),
DUCKDB_AGGREGATE_FUNCTION_ALIAS(VarianceFun),
DUCKDB_SCALAR_FUNCTION(VectorTypeFun),
DUCKDB_SCALAR_FUNCTION(VersionFun),
DUCKDB_SCALAR_FUNCTION_SET(WeekFun),
DUCKDB_SCALAR_FUNCTION_SET(WeekDayFun),
Expand Down
1 change: 1 addition & 0 deletions src/core_functions/scalar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_subdirectory(random)
add_subdirectory(string)
add_subdirectory(struct)
add_subdirectory(union)
add_subdirectory(debug)

set(ALL_OBJECT_FILES
${ALL_OBJECT_FILES}
Expand Down
4 changes: 4 additions & 0 deletions src/core_functions/scalar/debug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_library_unity(duckdb_func_debug OBJECT vector_type.cpp)
set(ALL_OBJECT_FILES
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:duckdb_func_debug>
PARENT_SCOPE)
9 changes: 9 additions & 0 deletions src/core_functions/scalar/debug/functions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"name": "vector_type",
"parameters": "col",
"description": "Returns the VectorType of a given column",
"example": "vector_type(col)",
"type": "scalar_function"
}
]
23 changes: 23 additions & 0 deletions src/core_functions/scalar/debug/vector_type.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "duckdb/core_functions/scalar/debug_functions.hpp"

#include "duckdb/common/exception.hpp"
#include "duckdb/common/vector_operations/vector_operations.hpp"
#include "duckdb/planner/expression/bound_function_expression.hpp"
#include "duckdb/common/enum_util.hpp"

namespace duckdb {

static void VectorTypeFunction(DataChunk &input, ExpressionState &state, Vector &result) {
result.SetVectorType(VectorType::CONSTANT_VECTOR);
auto data = ConstantVector::GetData<string_t>(result);
data[0] = StringVector::AddString(result, EnumUtil::ToString(input.data[0].GetVectorType()));
}

ScalarFunction VectorTypeFun::GetFunction() {
return ScalarFunction("vector_type", // name of the function
{LogicalType::ANY}, // argument list
LogicalType::VARCHAR, // return type
VectorTypeFunction);
}

} // namespace duckdb
1 change: 1 addition & 0 deletions src/execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ add_library_unity(
physical_plan_generator.cpp
radix_partitioned_hashtable.cpp
reservoir_sample.cpp
window_executor.cpp
window_segment_tree.cpp)
set(ALL_OBJECT_FILES
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:duckdb_execution>
Expand Down
Loading

0 comments on commit 21b61c4

Please sign in to comment.