Skip to content

Commit 392b804

Browse files
huan233uscwgtmac
authored andcommitted
Document CastDefaultToType null-pointer precondition
1 parent f0ac7a2 commit 392b804

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/iceberg/update/update_schema.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ std::vector<SchemaField> ApplyChangesVisitor::MoveFields(
299299
/// the column scale), so differing scales fall through to `CastTo` and are rejected. All
300300
/// other conversions delegate to `CastTo`, which reports narrowing via AboveMax/BelowMin
301301
/// sentinels that callers reject.
302+
///
303+
/// \pre `target_type` is non-null; every caller passes a resolved field type. `value` is
304+
/// the caller's dereferenced default, so a missing default must be filtered out before
305+
/// this is reached.
302306
Result<Literal> CastDefaultToType(const Literal& value,
303307
const std::shared_ptr<PrimitiveType>& target_type) {
304308
if (value.type()->type_id() == TypeId::kDecimal &&

0 commit comments

Comments
 (0)