@@ -272,7 +272,7 @@ TEST_P(UpdatePartitionSpecTest, TestAddTruncate) {
272272
273273TEST_P (UpdatePartitionSpecTest, TestAddNamedPartition) {
274274 auto update = CreateUpdatePartitionSpec (format_version_, unpartitioned_);
275- update->AddField (" shard " , Expressions::Bucket (" id" , 16 ));
275+ update->AddField (Expressions::Bucket (" id" , 16 ), " shard " );
276276 ASSERT_THAT (update->Apply (), IsOk ());
277277
278278 ICEBERG_UNWRAP_OR_FAIL (auto updated_spec, update->GetAppliedSpec ());
@@ -312,8 +312,8 @@ TEST_P(UpdatePartitionSpecTest, TestMultipleAdds) {
312312 auto update = CreateUpdatePartitionSpec (format_version_, unpartitioned_);
313313 update->AddField (" category" )
314314 .AddField (Expressions::Day (" ts" ))
315- .AddField (" shard " , Expressions::Bucket (" id" , 16 ))
316- .AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
315+ .AddField (Expressions::Bucket (" id" , 16 ), " shard " )
316+ .AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
317317 ASSERT_THAT (update->Apply (), IsOk ());
318318
319319 ICEBERG_UNWRAP_OR_FAIL (auto updated_spec, update->GetAppliedSpec ());
@@ -571,7 +571,7 @@ TEST_P(UpdatePartitionSpecTest, TestMultipleChanges) {
571571 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
572572 update->RenameField (" shard" , " id_bucket" )
573573 .RemoveField (Expressions::Day (" ts" ))
574- .AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
574+ .AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
575575 ASSERT_THAT (update->Apply (), IsOk ());
576576
577577 ICEBERG_UNWRAP_OR_FAIL (auto updated_spec, update->GetAppliedSpec ());
@@ -635,32 +635,32 @@ TEST_P(UpdatePartitionSpecTest, TestAddDeletedName) {
635635
636636TEST_P (UpdatePartitionSpecTest, TestRemoveNewlyAddedFieldByName) {
637637 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
638- update->AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
638+ update->AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
639639 update->RemoveField (" prefix" );
640640 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
641641 EXPECT_THAT (update->Apply (), HasErrorMessage (" Cannot delete newly added field" ));
642642}
643643
644644TEST_P (UpdatePartitionSpecTest, TestRemoveNewlyAddedFieldByTransform) {
645645 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
646- update->AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
646+ update->AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
647647 update->RemoveField (Expressions::Truncate (" data" , 4 ));
648648 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
649649 EXPECT_THAT (update->Apply (), HasErrorMessage (" Cannot delete newly added field" ));
650650}
651651
652652TEST_P (UpdatePartitionSpecTest, TestAddAlreadyAddedFieldByTransform) {
653653 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
654- update->AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
654+ update->AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
655655 update->AddField (Expressions::Truncate (" data" , 4 ));
656656 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
657657 EXPECT_THAT (update->Apply (), HasErrorMessage (" Cannot add duplicate partition field" ));
658658}
659659
660660TEST_P (UpdatePartitionSpecTest, TestAddAlreadyAddedFieldByName) {
661661 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
662- update->AddField (" prefix " , Expressions::Truncate (" data" , 4 ));
663- update->AddField (" prefix " , Expressions::Truncate (" data" , 6 ));
662+ update->AddField (Expressions::Truncate (" data" , 4 ), " prefix " );
663+ update->AddField (Expressions::Truncate (" data" , 6 ), " prefix " );
664664 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
665665 EXPECT_THAT (update->Apply (), HasErrorMessage (" Cannot add duplicate partition field" ));
666666}
@@ -684,7 +684,7 @@ TEST_P(UpdatePartitionSpecTest, TestAddRedundantTimePartition) {
684684TEST_P (UpdatePartitionSpecTest, TestNoEffectAddDeletedSameFieldWithSameName) {
685685 auto update1 = CreateUpdatePartitionSpec (format_version_, partitioned_);
686686 update1->RemoveField (" shard" );
687- update1->AddField (" shard " , Expressions::Bucket (" id" , 16 ));
687+ update1->AddField (Expressions::Bucket (" id" , 16 ), " shard " );
688688 ASSERT_THAT (update1->Apply (), IsOk ());
689689 ICEBERG_UNWRAP_OR_FAIL (auto spec1, update1->GetAppliedSpec ());
690690 AssertPartitionSpecEquals (*partitioned_, *spec1);
@@ -700,7 +700,7 @@ TEST_P(UpdatePartitionSpecTest, TestNoEffectAddDeletedSameFieldWithSameName) {
700700TEST_P (UpdatePartitionSpecTest, TestGenerateNewSpecAddDeletedSameFieldWithDifferentName) {
701701 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
702702 update->RemoveField (" shard" );
703- update->AddField (" new_shard " , Expressions::Bucket (" id" , 16 ));
703+ update->AddField (Expressions::Bucket (" id" , 16 ), " new_shard " );
704704 ASSERT_THAT (update->Apply (), IsOk ());
705705
706706 ICEBERG_UNWRAP_OR_FAIL (auto updated_spec, update->GetAppliedSpec ());
@@ -738,7 +738,7 @@ TEST_P(UpdatePartitionSpecTest, TestAddDuplicateTransform) {
738738
739739TEST_P (UpdatePartitionSpecTest, TestAddNamedDuplicate) {
740740 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
741- update->AddField (" b16 " , Expressions::Bucket (" id" , 16 ));
741+ update->AddField (Expressions::Bucket (" id" , 16 ), " b16 " );
742742 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
743743 EXPECT_THAT (update->Apply (), HasErrorMessage (" Cannot add duplicate partition field" ));
744744}
@@ -767,7 +767,7 @@ TEST_P(UpdatePartitionSpecTest, TestRenameUnknownField) {
767767
768768TEST_P (UpdatePartitionSpecTest, TestRenameAfterAdd) {
769769 auto update = CreateUpdatePartitionSpec (format_version_, partitioned_);
770- update->AddField (" data_trunc " , Expressions::Truncate (" data" , 4 ));
770+ update->AddField (Expressions::Truncate (" data" , 4 ), " data_trunc " );
771771 update->RenameField (" data_trunc" , " prefix" );
772772 EXPECT_THAT (update->Apply (), IsError (ErrorKind::kValidationFailed ));
773773 EXPECT_THAT (update->Apply (),
@@ -795,7 +795,7 @@ TEST_P(UpdatePartitionSpecTest, TestDeleteAndRename) {
795795TEST_P (UpdatePartitionSpecTest, TestRemoveAndAddMultiTimes) {
796796 // Add first time
797797 auto update1 = CreateUpdatePartitionSpec (format_version_, unpartitioned_);
798- update1->AddField (" ts_date " , Expressions::Day (" ts" ));
798+ update1->AddField (Expressions::Day (" ts" ), " ts_date " );
799799 ASSERT_THAT (update1->Apply (), IsOk ());
800800 ICEBERG_UNWRAP_OR_FAIL (auto add_first_time_spec, update1->GetAppliedSpec ());
801801
@@ -813,7 +813,7 @@ TEST_P(UpdatePartitionSpecTest, TestRemoveAndAddMultiTimes) {
813813 auto catalog2 = std::make_shared<MockCatalog>();
814814 TableIdentifier identifier2{.ns = Namespace{.levels = {" test" }}, .name = " test_table" };
815815 auto update3 = std::make_unique<UpdatePartitionSpec>(identifier2, catalog2, metadata2);
816- update3->AddField (" ts_date " , Expressions::Day (" ts" ));
816+ update3->AddField (Expressions::Day (" ts" ), " ts_date " );
817817 ASSERT_THAT (update3->Apply (), IsOk ());
818818 ICEBERG_UNWRAP_OR_FAIL (auto add_second_time_spec, update3->GetAppliedSpec ());
819819
@@ -876,7 +876,7 @@ TEST_P(UpdatePartitionSpecTest, TestRemoveAndUpdateWithDifferentTransformation)
876876 TableIdentifier identifier{.ns = Namespace{.levels = {" test" }}, .name = " test_table" };
877877 auto update = std::make_unique<UpdatePartitionSpec>(identifier, catalog, metadata);
878878 update->RemoveField (" ts_transformed" );
879- update->AddField (" ts_transformed " , Expressions::Day (" ts" ));
879+ update->AddField (Expressions::Day (" ts" ), " ts_transformed " );
880880 ASSERT_THAT (update->Apply (), IsOk ());
881881
882882 ICEBERG_UNWRAP_OR_FAIL (auto updated_spec, update->GetAppliedSpec ());
0 commit comments