JingsongLi commented on code in PR #10190:
URL: https://github.com/apache/paimon/pull/10190#discussion_r4179936523
##########
paimon-python/pypaimon/read/reader/format_vortex_reader.py:
##########
@@ -45,9 +45,18 @@ def __init__(self, file_io: FileIO, file_path: str,
read_fields: List[DataField]
file_path_for_vortex, store_kwargs = to_vortex_specified(file_io,
file_path)
if store_kwargs:
+ from urllib.parse import urlparse
+
from vortex import store
vortex_store = store.from_url(file_path_for_vortex, **store_kwargs)
- vortex_file = vortex_store.open()
+ # vortex 0.70.0 object stores (S3Store et al.) expose no
``.open()``;
+ # the entry point is ``vortex.open(path, store=...)``. The store is
+ # virtual-hosted (the bucket is in the endpoint host), so ``path``
must
+ # be the object key relative to that store, not the full
+ # ``s3://bucket/key`` URL -- otherwise the bucket is resolved
twice and
+ # the read fails.
+ object_key = urlparse(file_path_for_vortex).path.lstrip("/")
+ vortex_file = vortex.open(object_key, store=vortex_store)
Review Comment:
[P1] Use an empty path with the existing file-prefixed store
Removing the URI scheme/bucket does not make this path relative to the store
constructed on line 51. `store.from_url(full_file_uri)` already prefixes the
store with the full object key, so `vortex.open(object_key, store=...)` appends
that key a second time. On this exact head, the real 0.70.0 SDK and actual
reader request `/fixture.vortex/fixture.vortex` for `oss://127/fixture.vortex`
and fail with 404; ordinary table paths similarly become
`db/table/file.vortex/db/table/file.vortex`. The previous review described this
prefix behavior. Keeping the same store and passing an empty string reads 500
rows/nulls correctly, with filtering, row indices, shard ranges, projection and
signed requests validated. Please either use `vortex.open("",
store=vortex_store)` with the current file-prefixed store, or change `from_url`
to construct a bucket-root store before passing the object key. The new
fake-SDK assertion enforces the doubled-key call and cannot validate the native
prefix contract.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]