You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by hu...@apache.org on 2026/01/19 18:55:51 UTC

(iceberg) branch main updated: API: Use Transform#isIdentity in PartitionSpec#identitySourceIds (#15066)

This is an automated email from the ASF dual-hosted git repository.

huaxingao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b573c7b46 API: Use Transform#isIdentity in PartitionSpec#identitySourceIds (#15066)
9b573c7b46 is described below

commit 9b573c7b46950a41d614c4240752f255282d8c1f
Author: Raunaq Morarka <ra...@users.noreply.github.com>
AuthorDate: Tue Jan 20 00:25:45 2026 +0530

    API: Use Transform#isIdentity in PartitionSpec#identitySourceIds (#15066)
    
    Avoids the need to do a String conversion and comparision
---
 api/src/main/java/org/apache/iceberg/PartitionSpec.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/api/src/main/java/org/apache/iceberg/PartitionSpec.java b/api/src/main/java/org/apache/iceberg/PartitionSpec.java
index bbd59aa083..c9350077e9 100644
--- a/api/src/main/java/org/apache/iceberg/PartitionSpec.java
+++ b/api/src/main/java/org/apache/iceberg/PartitionSpec.java
@@ -315,7 +315,7 @@ public class PartitionSpec implements Serializable {
   public Set<Integer> identitySourceIds() {
     Set<Integer> sourceIds = Sets.newHashSet();
     for (PartitionField field : fields()) {
-      if ("identity".equals(field.transform().toString())) {
+      if (field.transform().isIdentity()) {
         sourceIds.add(field.sourceId());
       }
     }