nastra commented on issue #10234: URL: https://github.com/apache/iceberg/issues/10234#issuecomment-2117081412
I was able to reproduce this with this short example and I agree that this is a bug that we need to fix: ``` create schema iceberg; create table iceberg.tbl (id int, trip_id int, distance int) partitioned by (bucket(8, trip_id)); insert into iceberg.tbl values (1, 1, 10); alter table iceberg.tbl replace partition field trip_id_bucket with bucket(4, distance); alter table iceberg.tbl drop column trip_id; select * from iceberg.tbl; ``` ``` Caused by: org.apache.iceberg.exceptions.ValidationException: Cannot find source column for partition field: 1000: trip_id_bucket: bucket[8](2) at org.apache.iceberg.exceptions.ValidationException.check(ValidationException.java:49) at org.apache.iceberg.PartitionSpec.checkCompatibility(PartitionSpec.java:562) at org.apache.iceberg.PartitionSpec$Builder.build(PartitionSpec.java:543) at org.apache.iceberg.UnboundPartitionSpec.bind(UnboundPartitionSpec.java:46) at org.apache.iceberg.PartitionSpecParser.fromJson(PartitionSpecParser.java:71) at org.apache.iceberg.PartitionSpecParser.lambda$fromJson$1(PartitionSpecParser.java:88) at org.apache.iceberg.util.JsonUtil.parse(JsonUtil.java:98) at org.apache.iceberg.PartitionSpecParser.lambda$fromJson$2(PartitionSpecParser.java:88) at org.apache.iceberg.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406) at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908) at org.apache.iceberg.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404) at org.apache.iceberg.shaded.com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387) at org.apache.iceberg.shaded.com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108) at org.apache.iceberg.shaded.com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:62) at org.apache.iceberg.PartitionSpecParser.fromJson(PartitionSpecParser.java:86) at org.apache.iceberg.BaseContentScanTask.spec(BaseContentScanTask.java:71) at org.apache.iceberg.BaseFileScanTask.spec(BaseFileScanTask.java:27) at org.apache.iceberg.BaseFileScanTask$SplitScanTask.spec(BaseFileScanTask.java:127) at org.apache.iceberg.util.PartitionUtil.constantsMap(PartitionUtil.java:49) at org.apache.iceberg.util.PartitionUtil.constantsMap(PartitionUtil.java:42) at org.apache.iceberg.spark.source.BaseReader.constantsMap(BaseReader.java:198) at org.apache.iceberg.spark.source.BatchDataReader.open(BatchDataReader.java:91) at org.apache.iceberg.spark.source.BatchDataReader.open(BatchDataReader.java:41) at org.apache.iceberg.spark.source.BaseReader.next(BaseReader.java:143) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org