| 1 | #include "duckdb/function/cast/default_casts.hpp" |
|---|---|
| 2 | #include "duckdb/common/operator/cast_operators.hpp" |
| 3 | #include "duckdb/function/cast/vector_cast_helpers.hpp" |
| 4 | |
| 5 | namespace duckdb { |
| 6 | |
| 7 | BoundCastInfo DefaultCasts::UUIDCastSwitch(BindCastInput &input, const LogicalType &source, const LogicalType &target) { |
| 8 | // now switch on the result type |
| 9 | switch (target.id()) { |
| 10 | case LogicalTypeId::VARCHAR: |
| 11 | // uuid to varchar |
| 12 | return BoundCastInfo(&VectorCastHelpers::StringCast<hugeint_t, duckdb::CastFromUUID>); |
| 13 | default: |
| 14 | return TryVectorNullCast; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | } // namespace duckdb |
| 19 |