You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "tanmayrauth (via GitHub)" <gi...@apache.org> on 2026/06/03 19:04:08 UTC
[PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
tanmayrauth opened a new pull request, #1162:
URL: https://github.com/apache/iceberg-go/pull/1162
writerFactory.partitionLocProvider was passing only WriteDataPathKey to LoadLocationProvider, dropping write.object-storage.enabled and other table props. As a result, partitioned writes always fell back to the simple Hadoop-style layout, ignoring the object-storage entropy prefix.
Store the table props on the factory and copy them when constructing partition props, overlaying only the partition-specific data path.
Fixes: #1155
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "xixipi-lining (via GitHub)" <gi...@apache.org>.
xixipi-lining commented on PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162#issuecomment-4629626340
@tanmayrauth Sounds like a solid plan. Let's land this regression fix first.
I completely agree with tackling the LocationProvider evolution in a follow-up issue. Feel free to draft the interface signature there so we can align before diving into the code.
LGTM for this PR. Thanks for driving this!
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "xixipi-lining (via GitHub)" <gi...@apache.org>.
xixipi-lining commented on PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162#issuecomment-4628758033
Hi @tanmayrauth , thanks for working on this fix!
While this approach resolves the issue, I have an architectural concern regarding writerFactory. Storing tableProps on the factory just to pass them down into LoadLocationProvider for each partition adds extra state to it, which we should try to avoid to keep its responsibilities focused.
If we look at the [Java implementation of LocationProvider](https://github.com/apache/iceberg/blob/main/api/src/main/java/org/apache/iceberg/io/LocationProvider.java), it actually provides a partition-aware method:
newDataLocation(PartitionSpec spec, StructLike partitionData, String filename)
Long term, evolving our LocationProvider to be partition-aware like Java's would cleanly remove the need for writerFactory to manage tableProps or rebuild providers per partition.
What are your thoughts on taking this direction?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162#discussion_r3375720792
##########
table/rolling_data_writer.go:
##########
@@ -219,8 +221,12 @@ func (w *writerFactory) partitionLocProvider(partitionPath string) (LocationProv
}
partitionDataPath := w.rootURL.JoinPath("data", partitionPath).String()
- loc, err := LoadLocationProvider(w.rootLocation,
- iceberg.Properties{WriteDataPathKey: partitionDataPath})
+ partitionProps := make(iceberg.Properties, len(w.tableProps)+1)
+ for k, v := range w.tableProps {
+ partitionProps[k] = v
+ }
Review Comment:
`maps.Copy`?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "tanmayrauth (via GitHub)" <gi...@apache.org>.
tanmayrauth commented on PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162#issuecomment-4629111009
Thanks @xixipi-lining, that's a fair point and I agree on the direction.
On this PR's scope. I'd like to keep this minimal because #1155 is a correctness regression — write.object-storage.enabled is silently ignored on partitioned writes today, so partitioned tables end up with no entropy at all in their data paths. The two extra fields on writerFactory restore the documented behavior without changing any public API. I'd rather land that on its own than gate the bug fix behind an interface change.
On the architectural direction. Agreed that long-term the partition-aware overload is the right shape. I checked the Java reference and LocationProvider declares it as an abstract method on the interface itself:
String newDataLocation(PartitionSpec spec, StructLike partitionData, String filename);
with ObjectStoreLocationProvider folding the partition path into the hash input when includePartitionPaths=true, and dropping the partition entirely when it's false. That's actually a stronger argument than I first realized: the factory-rebuilds-per-partition pattern in Go can't reproduce that layout no matter what props you pass — the hash dirs end up after the partition path instead of before, and the hash input is filename-only. So this PR restores entropy, but it does not yet make Go match Java's spec for partitioned object-storage layout.
That makes the follow-up worth doing properly:
- add the partition-aware method to LocationProvider
- have objectStoreLocationProvider produce Java's layout (<storage>/<hash>/<partitionPath>/<filename> with partition folded into the hash) and honor includePartitionPaths=false by dropping the partition
- remove tableProps and partitionLocProvider from writerFactory once the call sites move over
That's a public-interface change and a behavior change for anyone already on the current partitioned layout, so it deserves its own PR with a clear note in the changelog. Happy to file the follow-up issue and pick it up after this lands — or, if you'd prefer, I can draft the interface signature first so we can align before either of us writes code.
WDYT — land this as the regression fix and tackle the interface evolution separately?
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "tanmayrauth (via GitHub)" <gi...@apache.org>.
tanmayrauth commented on code in PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162#discussion_r3375819352
##########
table/rolling_data_writer.go:
##########
@@ -219,8 +221,12 @@ func (w *writerFactory) partitionLocProvider(partitionPath string) (LocationProv
}
partitionDataPath := w.rootURL.JoinPath("data", partitionPath).String()
- loc, err := LoadLocationProvider(w.rootLocation,
- iceberg.Properties{WriteDataPathKey: partitionDataPath})
+ partitionProps := make(iceberg.Properties, len(w.tableProps)+1)
+ for k, v := range w.tableProps {
+ partitionProps[k] = v
+ }
Review Comment:
Good call, done, switched to maps.Copy.
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] fix(table): preserve table props when building partition location provider (#1155) [iceberg-go]
Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #1162:
URL: https://github.com/apache/iceberg-go/pull/1162
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org