forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
2,237 additions
and
1,403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.