Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
404a480
Bind QUADBIN/TQUADBIN cell index types
estebanzimanyi Jun 23, 2026
76806cb
Initialize MEOS per worker thread and adapt table functions to DuckDB…
estebanzimanyi Jun 23, 2026
8088db1
Use the canonical 2-arg spatiotemporal relationships
estebanzimanyi Jun 23, 2026
69e6e5a
Refresh parity expecteds for the pinned MEOS behaviour
estebanzimanyi Jun 23, 2026
af1db19
Pin vcpkg MEOS to ecosystem-pin-2026-06-22a
estebanzimanyi Jun 23, 2026
6d90714
Use the canonical lowercase MEOS type names for accessors and aliases
estebanzimanyi Jun 24, 2026
39ae894
Register the tbigint temporal type
estebanzimanyi Jun 24, 2026
4ca0c3d
Generate the scalar UDF surface from the MEOS-API catalog
estebanzimanyi Jun 24, 2026
3392e7c
Fail generation if a generated UDF body lacks the per-thread MEOS-ini…
estebanzimanyi Jun 24, 2026
5db080c
Generate the similarity analytics functions, dropping the hand regist…
estebanzimanyi Jun 24, 2026
044e4de
Generate the DuckDB operator symbols from the catalog via a reg_names…
estebanzimanyi Jun 25, 2026
926d381
Bump the MEOS base to the 26a pin and regenerate
estebanzimanyi Jun 26, 2026
1725cef
Generate the temporal comparison functions, dropping the hand registr…
estebanzimanyi Jun 26, 2026
c86bf8b
Gate the two retire traps in the generator (build-failing)
estebanzimanyi Jun 26, 2026
dd35d00
Build the vendored libmeos with all families (and Arrow) enabled
estebanzimanyi Jun 27, 2026
4a5585e
Regenerate the UDFs for the complete all-family MEOS surface
estebanzimanyi Jun 27, 2026
ebb23aa
Generate the similarity path functions as table functions from the ca…
estebanzimanyi Jun 27, 2026
cfb7840
Generate null-safe span/box functions for empty pointer returns
estebanzimanyi Jun 27, 2026
33663a9
Make all generated pointer-returning scalar functions null-safe
estebanzimanyi Jun 27, 2026
fda2c03
Generate the canonical scalar surface without the g_ coexist prefix
estebanzimanyi Jun 27, 2026
4023196
Refresh the temporal comparison test to the generated single-letter n…
estebanzimanyi Jul 6, 2026
d4461b9
Bump the vendored MEOS to the all-families upstream base and vendor t…
estebanzimanyi Jul 6, 2026
5c2aff7
Build the vendored MEOS without the pointcloud family
estebanzimanyi Jul 8, 2026
66512df
MobilityDuck generator: canonical names + geo spatial-relationship ge…
estebanzimanyi Jul 8, 2026
0cc58f9
Add regen-from-pin.sh: the binding's owned pin-bump + regenerate tool
estebanzimanyi Jul 8, 2026
8734b5a
Bump MEOS pin to MobilityDB master b711987, enable RASTER, regenerate
estebanzimanyi Jul 8, 2026
40dccdc
Generate temporal point accessors from the catalog SQL return type
estebanzimanyi Jul 8, 2026
d9f92cb
Generate the tspatial transform and text-output functions from the ca…
estebanzimanyi Jul 9, 2026
e79c8ef
Track upstream MobilityDB master directly for the MEOS base
estebanzimanyi Jul 9, 2026
9c8f74c
Scope generated bbox topological ops to their bounding-box dimension
estebanzimanyi Jul 9, 2026
86c2307
Retire the hand tspatial topological registrations onto the generated…
estebanzimanyi Jul 9, 2026
c0a1f13
Register bbox-topological ops by their canonical name and re-baseline…
estebanzimanyi Jul 9, 2026
d7b0e97
Re-baseline vendored MEOS to upstream master 23119abc4 and adopt Meos…
estebanzimanyi Jul 9, 2026
ebded3e
Retire hand-written geo relationship and positional ops via the gener…
estebanzimanyi Jul 9, 2026
73a936f
Re-baseline vendored MEOS to upstream master 579d5ca4f
estebanzimanyi Jul 9, 2026
da66b64
Retire hand-written bbox-topological ops via the generator
estebanzimanyi Jul 9, 2026
c747337
Vendor the MEOS catalog at a stable path and track upstream master
estebanzimanyi Jul 9, 2026
937ff20
feat: TemporalParquet footer, geodetic SRID handling, and edge-to-clo…
estebanzimanyi Jul 8, 2026
77ca7ba
Generate the geodetic geometry coercion for geo-relationship functions
estebanzimanyi Jul 9, 2026
ee68ac0
Keep integer-returning symbols in the codegen header gate
estebanzimanyi Jul 9, 2026
b9fb233
Generate the temporal math functions and drop their hand registrations
estebanzimanyi Jul 9, 2026
4a6bc23
Generate the ever/always temporal comparisons and drop their hand reg…
estebanzimanyi Jul 9, 2026
b6e0a9b
Generate the spatial ever/always comparisons and drop their hand regi…
estebanzimanyi Jul 9, 2026
95ea227
Generate the spatial temporal comparisons and drop their hand registr…
estebanzimanyi Jul 9, 2026
c06c3cf
Generate the spatial-family temporal comparisons and drop the geo ali…
estebanzimanyi Jul 9, 2026
57f02cb
Generate the subtype-pointer temporal accessors
estebanzimanyi Jul 9, 2026
ec6f9a1
Register generic temporal functions over their catalog-declared types
estebanzimanyi Jul 9, 2026
a0bcc08
Remove the phantom textspan and textspanset types
estebanzimanyi Jul 10, 2026
61598da
Generate the collection type registration from the catalog
estebanzimanyi Jul 10, 2026
f5c49bc
Scope set round to floatset from the catalog signature
estebanzimanyi Jul 10, 2026
c9439ff
Retire the hand 2-arg set round registration
estebanzimanyi Jul 10, 2026
575c1ab
Generate set round at both arities from the catalog default
estebanzimanyi Jul 10, 2026
28f9cbe
Generate float scalar transforms across set/span/spanset/temporal fro…
estebanzimanyi Jul 10, 2026
98d22bc
Re-baseline the vendored MEOS to upstream master 6b80019ef
estebanzimanyi Jul 10, 2026
ef47470
Rename the generator shape classifiers from poc_ to shape_
estebanzimanyi Jul 10, 2026
b3d4849
Re-baseline the vendored MEOS to upstream master 363bd228e5
estebanzimanyi Jul 10, 2026
84b3a30
Generate the array-return accessors from the catalog and retire the h…
estebanzimanyi Jul 10, 2026
62b358e
Build the meos port's H3 and RASTER families from the vcpkg h3 and gd…
estebanzimanyi Jul 10, 2026
e59c02d
Build the MEOS port with -DALL and re-baseline to master 79f24b7948
estebanzimanyi Jul 10, 2026
176a152
Generate the temporal conversion functions from the catalog
estebanzimanyi Jul 10, 2026
aff3e51
Retire the hand temporal.cpp positional predicates in favour of the g…
estebanzimanyi Jul 11, 2026
c17e190
Retire the hand geo time-axis positional predicates in favour of the …
estebanzimanyi Jul 11, 2026
398b209
Re-vendor the catalog from master and bump the -DALL meos port
estebanzimanyi Jul 11, 2026
5144d2d
Generate the set/span positional operators and retire the hand regist…
estebanzimanyi Jul 11, 2026
6ab17da
Generate the set/span topological operators and retire the hand regis…
estebanzimanyi Jul 11, 2026
d3715e7
Overlay the h3 vcpkg port to disable its in-tree clang-tidy under wasm
estebanzimanyi Jul 11, 2026
1e8d8c3
Retire the hand temporal topological operators
estebanzimanyi Jul 11, 2026
0800edb
Add a DuckDB inherited-behaviour generator (design reference)
estebanzimanyi Jul 11, 2026
12d919a
Register the cbuffer/tcbuffer family
estebanzimanyi Jul 11, 2026
04c43ab
Inherit the TSpatial<T> and Temporal<T> surface for tcbuffer
estebanzimanyi Jul 11, 2026
f2289dc
Generate the Temporal<T> base-value accessors for tcbuffer
estebanzimanyi Jul 11, 2026
b1df7f1
Generate the tcbuffer convexHull spatial accessor
estebanzimanyi Jul 11, 2026
e90de37
Derive the MEOS catalog in CI instead of vendoring it
estebanzimanyi Jul 11, 2026
cbd12ec
Generate the (Temporal, base-value) binary operations for pointer-val…
estebanzimanyi Jul 11, 2026
6bb3225
Generate the atValues/minusValues range restriction from the catalog
estebanzimanyi Jul 11, 2026
8ec08ac
Generate the atTbox/minusTbox box restriction from the catalog
estebanzimanyi Jul 11, 2026
470ab6a
Generate the temporal number span and span set restrictions
estebanzimanyi Jul 11, 2026
93c073c
Load MEOS from a single pinned source commit
estebanzimanyi Jul 15, 2026
ac50658
Merge upstream main into the generator branch
estebanzimanyi Jul 15, 2026
658cc90
Bind point temporal touches to the trajectory kernel and wire NxN min…
estebanzimanyi Jul 15, 2026
df7d0f1
Generate the NxN set-set *Pairs relationship SRFs
estebanzimanyi Jul 15, 2026
2c4f398
Generate the temporal instant/sequence/sequence-set constructors
estebanzimanyi Jul 15, 2026
4e21330
Generate the temporal FromHexWKB and FromMFJSON parsers
estebanzimanyi Jul 15, 2026
1c893e0
Generate the set/span/spanset FromHexWKB parsers
estebanzimanyi Jul 15, 2026
b8e08bf
Bump the MEOS source commit to e6e2912d3
estebanzimanyi Jul 15, 2026
b78e3d8
Generate the asHexWKB output surface for temporal types
estebanzimanyi Jul 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# Derives the MEOS catalog from MobilityDB in CI (instead of committing a
# meos-idl.json snapshot) and verifies that the committed generated UDF surface
# still matches a fresh derivation. This is the shared ecosystem model: bindings
# stop vendoring the catalog and derive it from one MobilityDB commit via the
# MEOS-API provision-meos action (the JMEOS/Spark/Flink/Kafka pattern).
#
name: Derive catalog and verify generated code

on:
pull_request:
branches:
- main
- 'feat/**'
- 'fix/**'
paths-ignore:
- '**/README.md'
- 'doc/**'
push:
branches:
- main
paths-ignore:
- '**/README.md'
- 'doc/**'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}
cancel-in-progress: true

jobs:
derive-and-verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# The catalog is derived from the SAME MobilityDB commit the vcpkg MEOS
# port builds libmeos from, so the generated code always matches the
# libmeos it is compiled against. tools/meos-source-commit.txt is the
# single source of truth for that commit (the vcpkg portfile reads the same
# file), mirroring the shared ecosystem provision-meos model.
- name: Resolve the MobilityDB source commit
id: ref
run: echo "sha=$(tr -d '[:space:]' < tools/meos-source-commit.txt)" >> "$GITHUB_OUTPUT"

# Generate meos-idl.json from that commit via the shared MEOS-API action.
# Catalog only (build-libmeos: false): the generator is pure Python and
# reads the catalog JSON, so no libmeos build is needed here.
- name: Provision the MEOS catalog
id: provision
uses: MobilityDB/MEOS-API/.github/actions/provision-meos@master
with:
mobilitydb-ref: ${{ steps.ref.outputs.sha }}
build-libmeos: "false"

- name: Stage the catalog
run: |
mkdir -p tools/catalog
cp "${{ steps.provision.outputs.catalog-path }}" tools/catalog/meos-idl.json

# Regenerate the committed UDF surface and fail if it drifts. The committed
# src/generated/*.cpp (compiled by the distribution pipeline) must always
# equal a fresh derivation from the current catalog.
- name: Regenerate and check for drift
run: |
python3 tools/codegen_duck_udfs.py \
tools/catalog/meos-idl.json \
src/generated/generated_temporal_udfs.cpp
if ! git diff --exit-code src/generated/; then
echo "::error::src/generated is stale — re-run tools/codegen_duck_udfs.py against a freshly derived catalog and commit the result"
exit 1
fi
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ duckdb_unittest_tempdir/
.DS_Store
testext
test/python/__pycache__/
tools/__pycache__/
.Rhistory
vcpkg/
*.log
examples/quickstart/*.parquet

# Derived in CI from MobilityDB via MEOS-API provision-meos (see .github/workflows/generate.yml); not vendored.
tools/catalog/meos-idl.json
28 changes: 27 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ endif()
# MEOS from overlay port
find_package(MEOS CONFIG REQUIRED)

# H3 headers: the all-families libmeos exposes meos_h3.h, which includes
# <h3api.h>. SIBLING-FROM MobilityDB CMakeLists.txt H3 block (find_path
# H3_INCLUDE_DIR NAMES h3api.h PATH_SUFFIXES h3) so code compiling against
# meos_h3.h sees the system libh3 headers, just as the meos port (-DH3=ON) does.
# The dir is attached to the extension targets below (mirroring the json-c
# block) because build_*_extension targets don't inherit directory includes.
# SIBLING-FROM MobilityDB CMakeLists.txt H3 block; NO_CMAKE_FIND_ROOT_PATH + explicit
# system PATHS are the binding-side adaptation: under the vcpkg toolchain find_path is
# confined to the vcpkg root and never sees the system /usr/include/h3 that libh3-dev ships.
find_path(H3_INCLUDE_DIR NAMES h3api.h
PATH_SUFFIXES h3
PATHS /usr/include /usr/local/include
NO_CMAKE_FIND_ROOT_PATH)
if(NOT H3_INCLUDE_DIR)
message(FATAL_ERROR "h3api.h not found; install libh3-dev (the meos port is built with -DH3=ON).")
endif()

if(TARGET GEOS::geos_c)
set(GEOS_TGT GEOS::geos_c)
elseif(TARGET GEOS::geos)
Expand All @@ -57,7 +74,9 @@ include_directories(duckdb-spatial/src/spatial)

set(EXTENSION_SOURCES
src/spatial_ref_sys_csv.inc
src/mobilityduck_extension.cpp
src/mobilityduck_extension.cpp
src/generated/generated_temporal_udfs.cpp
src/generated/generated_type_registration.cpp
src/temporal/temporal.cpp
src/temporal/temporal_functions.cpp
src/temporal/temporal_aggregates.cpp
Expand Down Expand Up @@ -89,6 +108,8 @@ set(EXTENSION_SOURCES
src/geo/tgeogpoint.cpp
src/geo/tgeogpoint_in_out.cpp
src/geo/tgeogpoint_ops.cpp
src/quadbin/tquadbin.cpp
src/cbuffer/tcbuffer.cpp
src/index/rtree_module.cpp
src/single_tile_getters.cpp
src/index/rtree_index_create_physical.cpp
Expand All @@ -111,6 +132,11 @@ else()
set(JSONC_TGT ${JSON-C_LIBRARIES})
endif()

# H3 headers for meos_h3.h (see the find_path above) — attached per-target like
# json-c, since build_*_extension targets don't inherit directory includes.
target_include_directories(${EXTENSION_NAME} PRIVATE ${H3_INCLUDE_DIR})
target_include_directories(${LOADABLE_EXTENSION_NAME} PRIVATE ${H3_INCLUDE_DIR})

# -----------------------------
# Link libraries
# -----------------------------
Expand Down
46 changes: 28 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,39 @@ include extension-ci-tools/makefiles/duckdb_extension.Makefile
# "TimeZone") to Europe/Brussels. Tests pass on any OS timezone — the
# extension is the single source of truth, no TZ env var needed.
#
# LoadInternal also calls ExtensionHelper::AutoLoadExtension(db, "icu") so
# the timezone option is honoured. Autoload looks for the extension on disk
# at $HOME/.duckdb/extensions/<duckdb_version>/<platform>/icu.duckdb_extension
# and falls back to a hub download. That fails both inside the linux_amd64
# test docker container (empty path, no network egress) and on the macOS
# osx_arm64 test runner (hub icu not reliably resolvable). We copy the
# icu.duckdb_extension that was built locally as part of this extension's
# build (declared in extension_config.cmake) into the expected path,
# matched to the DuckDB platform string, before running the unittester.
# LoadInternal also auto-loads ICU so the named "Europe/Brussels" zone
# resolves. DuckDB autoloads ICU from
# $HOME/.duckdb/extensions/<version>/<platform>/icu.duckdb_extension
# and otherwise falls back to a hub download — which fails inside the CI test
# docker (empty path, no network egress) and on the macOS osx_arm64 runner
# (hub ICU not reliably resolvable). So we stage the locally-built ICU into the
# expected path before the unittester runs.
#
# Target DuckDB is the v1.4.x LTS line, with later versions (v1.5.x) supported
# in a multi-version matrix the same way MobilityDB supports PostgreSQL 13-18 —
# so the staging path must NOT hardcode the version or platform. We derive both
# from the freshly-built duckdb binary (authoritative for whatever is being
# tested); DUCKDB_VERSION_TAG and the uname map are fallbacks only.
DUCKDB_VERSION_TAG := v1.4.4

define stage_icu
@if [ -f ./build/$(1)/extension/icu/icu.duckdb_extension ]; then \
case "$$(uname -s)-$$(uname -m)" in \
Linux-x86_64) platform=linux_amd64 ;; \
Linux-aarch64) platform=linux_arm64 ;; \
Darwin-arm64) platform=osx_arm64 ;; \
Darwin-x86_64) platform=osx_amd64 ;; \
*) platform=$$(uname -m) ;; \
esac; \
target=$$HOME/.duckdb/extensions/$(DUCKDB_VERSION_TAG)/$$platform; \
duckdb_bin=./build/$(1)/duckdb; \
version_tag=$$( [ -x "$$duckdb_bin" ] && "$$duckdb_bin" --version 2>/dev/null | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1 ); \
platform=$$( [ -x "$$duckdb_bin" ] && echo 'PRAGMA platform;' | "$$duckdb_bin" -noheader -list 2>/dev/null | tr -d '[:space:]' ); \
[ -n "$$version_tag" ] || version_tag=$(DUCKDB_VERSION_TAG); \
if [ -z "$$platform" ]; then \
case "$$(uname -s)-$$(uname -m)" in \
Linux-x86_64) platform=linux_amd64 ;; \
Linux-aarch64) platform=linux_arm64 ;; \
Darwin-arm64) platform=osx_arm64 ;; \
Darwin-x86_64) platform=osx_amd64 ;; \
*) platform=$$(uname -m) ;; \
esac; \
fi; \
target=$$HOME/.duckdb/extensions/$$version_tag/$$platform; \
mkdir -p "$$target" && cp -f ./build/$(1)/extension/icu/icu.duckdb_extension "$$target/" && \
echo "Staged icu.duckdb_extension at $$target/"; \
echo "Staged icu.duckdb_extension at $$target/ (duckdb $$version_tag / $$platform)"; \
fi
endef

Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 4118 files
169 changes: 169 additions & 0 deletions src/cbuffer/tcbuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/* MobilityDuck binding for the MEOS circular-buffer types (cbuffer + tcbuffer).
*
* cbuffer is a varlena value (a point + a radius), surfaced as a BLOB.
* tcbuffer is the temporal circular buffer, stored as a Temporal* blob (BLOB).
*
* Only the type registration + text I/O boundary is hand-written here; the
* operation surface is generated from the MEOS-API catalog into src/generated/.
*/

#include "cbuffer/tcbuffer.hpp"
#include "temporal/temporal.hpp"
#include "tydef.hpp"
#include "duckdb/common/types/data_chunk.hpp"
#include "duckdb/main/extension/extension_loader.hpp"
#include "duckdb/common/extension_type_info.hpp"
#include "duckdb/function/scalar_function.hpp"
#include "mobilityduck/meos_exec_serial.hpp"
#include "time_util.hpp"

extern "C" {
#include <meos.h>
#include <meos_cbuffer.h>
#include <meos_internal.h>
}

#include <cstdlib>
#include <cstring>
#include <string>

namespace duckdb {

LogicalType CbufferTypes::cbuffer() {
auto type = LogicalType(LogicalTypeId::BLOB);
type.SetAlias("cbuffer");
return type;
}

LogicalType CbufferTypes::tcbuffer() {
auto type = LogicalType(LogicalTypeId::BLOB);
type.SetAlias("tcbuffer");
return type;
}

void CbufferTypes::RegisterTypes(ExtensionLoader &loader) {
loader.RegisterType("cbuffer", cbuffer());
loader.RegisterType("tcbuffer", tcbuffer());
}

namespace {

/* cbuffer is a varlena value: the stored BLOB holds the full varlena bytes, so
* copy-in by the blob size and copy-out by VARSIZE_ANY. */
inline Cbuffer *BlobToCbuffer(string_t blob) {
size_t sz = blob.GetSize();
void *copy = malloc(sz);
memcpy(copy, blob.GetData(), sz);
return reinterpret_cast<Cbuffer *>(copy);
}

inline string_t CbufferToBlob(Vector &result, Cbuffer *cb) {
if (!cb) return string_t();
/* Cbuffer is a 4-byte-header varlena (int32 vl_len_); VARSIZE reads it. */
size_t sz = VARSIZE(cb);
string_t out = StringVector::AddStringOrBlob(
result, string_t(reinterpret_cast<const char *>(cb), sz));
free(cb);
return out;
}

inline Temporal *BlobToTemp(string_t blob) {
size_t sz = blob.GetSize();
uint8_t *copy = (uint8_t *) malloc(sz);
memcpy(copy, blob.GetData(), sz);
return reinterpret_cast<Temporal *>(copy);
}

inline string_t TempToBlob(Vector &result, Temporal *t) {
if (!t) return string_t();
size_t sz = temporal_mem_size(t);
string_t out = StringVector::AddStringOrBlob(
result, string_t(reinterpret_cast<const char *>(t), sz));
free(t);
return out;
}

} // namespace

/* =====================================================================
* In / out — static cbuffer value
* ===================================================================== */

bool CbufferFunctions::Cbuffer_in_cast(
Vector &source, Vector &result, idx_t count, CastParameters &parameters)
{
UnaryExecutor::Execute<string_t, string_t>(
source, result, count,
[&](string_t s) -> string_t {
std::string str(s.GetData(), s.GetSize());
Cbuffer *cb = cbuffer_in(str.c_str());
return CbufferToBlob(result, cb);
});
return true;
}

bool CbufferFunctions::Cbuffer_out_cast(
Vector &source, Vector &result, idx_t count, CastParameters &parameters)
{
UnaryExecutor::Execute<string_t, string_t>(
source, result, count,
[&](string_t blob) -> string_t {
Cbuffer *cb = BlobToCbuffer(blob);
char *str = cbuffer_out(cb, OUT_DEFAULT_DECIMAL_DIGITS);
free(cb);
std::string copy(str);
free(str);
return StringVector::AddString(result, copy);
});
return true;
}

/* =====================================================================
* In / out — tcbuffer temporal value
* ===================================================================== */

bool CbufferFunctions::Tcbuffer_in_cast(
Vector &source, Vector &result, idx_t count, CastParameters &parameters)
{
UnaryExecutor::Execute<string_t, string_t>(
source, result, count,
[&](string_t s) -> string_t {
std::string str(s.GetData(), s.GetSize());
Temporal *t = tcbuffer_in(str.c_str());
return TempToBlob(result, t);
});
return true;
}

bool CbufferFunctions::Tcbuffer_out_cast(
Vector &source, Vector &result, idx_t count, CastParameters &parameters)
{
UnaryExecutor::Execute<string_t, string_t>(
source, result, count,
[&](string_t blob) -> string_t {
Temporal *t = BlobToTemp(blob);
char *str = temporal_out(t, OUT_DEFAULT_DECIMAL_DIGITS);
free(t);
std::string copy(str);
free(str);
return StringVector::AddString(result, copy);
});
return true;
}

/* =====================================================================
* Registration
* ===================================================================== */

void CbufferTypes::RegisterCastFunctions(ExtensionLoader &loader) {
RegisterMeosCastFunction(loader, LogicalType::VARCHAR, cbuffer(),
CbufferFunctions::Cbuffer_in_cast);
RegisterMeosCastFunction(loader, cbuffer(), LogicalType::VARCHAR,
CbufferFunctions::Cbuffer_out_cast);
RegisterMeosCastFunction(loader, LogicalType::VARCHAR, tcbuffer(),
CbufferFunctions::Tcbuffer_in_cast);
RegisterMeosCastFunction(loader, tcbuffer(), LogicalType::VARCHAR,
CbufferFunctions::Tcbuffer_out_cast);
}

} // namespace duckdb
Loading