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