You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "yuqi1129 (via GitHub)" <gi...@apache.org> on 2026/01/19 07:32:43 UTC
[I] [FEATURE] Support `tensorflow` to access Lance table view Lance REST service [gravitino]
yuqi1129 opened a new issue, #9748:
URL: https://github.com/apache/gravitino/issues/9748
### Describe the feature
The following example is what Lance supports to run a tensorflow to access Lance tables
```python
import tensorflow as tf
import lance
# Create tf dataset
ds = lance.tf.data.from_lance("s3://my-bucket/my-dataset")
# Chain tf dataset with other tf primitives
for batch in ds.shuffling(32).map(lambda x: tf.io.decode_png(x["image"])):
print(batch)
```
It's not very elegant and hard to maintain.
```
import tensorflow as tf
import lance
import lance.tf.data
import lance_namespace as ln
ns = ln.connect("rest", {"uri": "http://localhost:9101/lance"})
ds = lance.tf.data.from_lance(
namespace=ns,
table_id=["lance_catalog", "schema", "my_table52"],
batch_size=128,
columns=["id", "value"],
filter="id > 10",
ignore_namespace_table_storage_options=False,
)
ds....
```
### Motivation
_No response_
### Describe the solution
_No response_
### Additional context
_No response_
--
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: commits-unsubscribe@gravitino.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [FEATURE] Support `tensorflow` to access Lance table view Lance REST service [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on issue #9748:
URL: https://github.com/apache/gravitino/issues/9748#issuecomment-3766879999
Based on the PR https://github.com/lance-format/lance/pull/5750 , we should also try to upgrade the lance version of Gravitino Lance REST service, or the following error will occur:
```text
>>> ds = lance.tf.data.from_lance(
... namespace=ns,
... table_id=["lance_catalog", "schema", "my_table52"],
... batch_size=128,
... columns=["id", "value"],
... filter="id > 10",
... ignore_namespace_table_storage_options=False,
... )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/yuqi/project/lance/python/python/lance/tf/data.py", line 220, in from_lance
dataset = lance.dataset(
File "/Users/yuqi/project/lance/python/python/lance/__init__.py", line 217, in dataset
response = namespace.describe_table(request)
File "/Users/yuqi/project/lance/python/python/lance/namespace.py", line 262, in describe_table
response_dict = self._inner.describe_table(request.model_dump())
RuntimeError: Namespace error: Response error: ResponseContent { status: 400, content: "Unrecognized field \"with_table_uri\" (class com.lancedb.lance.namespace.model.DescribeTableRequest), not marked as ignorable (2 known properties: \"version\", \"id\"])\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 69] (through reference chain: com.lancedb.lance.namespace.model.DescribeTableRequest[\"with_table_uri\"])", entity: None }, /Users/yuqi/project/lance/rust/lance-namespace-impls/src/rest.rs:289:23
```
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org