Skip to content

Commit fc2d776

Browse files
committed
better exception if there is no column
1 parent af95973 commit fc2d776

File tree

1 file changed

+3
-0
lines changed
  • src/Storages/ObjectStorage/DataLakes/Iceberg

1 file changed

+3
-0
lines changed

src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ Poco::JSON::Object::Ptr getPartitionField(
421421

422422
Poco::JSON::Object::Ptr result = new Poco::JSON::Object;
423423
result->set(Iceberg::f_name, field.value());
424+
425+
if (!column_name_to_source_id.contains(*field))
426+
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Unknown field to partition {}", *field);
424427
result->set(Iceberg::f_source_id, column_name_to_source_id.at(*field));
425428
result->set(Iceberg::f_field_id, ++partition_iter);
426429

0 commit comments

Comments
 (0)