Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): expose remove_snapshots at Transaction API #884

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

TennyZhuang
Copy link
Contributor

A part of #743

For consistency with spark-procedure, may a better name is expire_snapshots. Before we support the entire list of parameters, a remove_snapshots public method that only supports specified snapshot_ids is still useful. We can consider deprecating this API in the future.

@TennyZhuang
Copy link
Contributor Author

TennyZhuang commented Jan 13, 2025

I am not sure if this is a server issue or a client issue, more research is needed.

If only one snapshot_id is passed, it can be successful.

table: TableIdent { namespace: NamespaceIdent(["data", "other"]), name: "1m_market_return_10m" }, snapshot_ids: [3419887305852055718, 3557841878473470571, 1963578191607528169, 3970602252979962677, 2254539859506811453, 7503617340073624129, 4090418433635376432, 3991054311210587887, 8251276597814139233, 1287384849826930466]
Error: Unexpected => Failed to parse response from rest catalog server!

Context:
   code: 500 Internal Server Error
   method: POST
   url: http://localhost:8182/v1/namespaces/data%1Fother/tables/1m_market_return_10m
   json: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 java.lang.IllegalArgumentException: Invalid set of snapshot ids to remove. Expected one value but received: [3419887305852055718, 3557841878473470571, 1963578191607528169, 3970602252979962677, 2254539859506811453, 7503617340073624129, 4090418433635376432, 3991054311210587887, 8251276597814139233, 1287384849826930466]</title>
</head>
<body><h2>HTTP ERROR 500 java.lang.IllegalArgumentException: Invalid set of snapshot ids to remove. Expected one value but received: [3419887305852055718, 3557841878473470571, 1963578191607528169, 3970602252979962677, 2254539859506811453, 7503617340073624129, 4090418433635376432, 3991054311210587887, 8251276597814139233, 1287384849826930466]</h2>
<table>
<tr><th>URI:</th><td>/v1/namespaces/data%1Fother/tables/1m_market_return_10m</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>java.lang.IllegalArgumentException: Invalid set of snapshot ids to remove. Expected one value but received: [3419887305852055718, 3557841878473470571, 1963578191607528169, 3970602252979962677, 2254539859506811453, 7503617340073624129, 4090418433635376432, 3991054311210587887, 8251276597814139233, 1287384849826930466]</td></tr>
<tr><th>SERVLET:</th><td>org.apache.iceberg.rest.RESTCatalogServlet-7d9f158f</td></tr>
<tr><th>CAUSED BY:</th><td>java.lang.IllegalArgumentException: Invalid set of snapshot ids to remove. Expected one value but received: [3419887305852055718, 3557841878473470571, 1963578191607528169, 3970602252979962677, 2254539859506811453, 7503617340073624129, 4090418433635376432, 3991054311210587887, 8251276597814139233, 1287384849826930466]</td></tr>
</table>
<hr><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.0</a><hr/>

</body>
</html>


Source: expected value at line 1 column 1

@TennyZhuang
Copy link
Contributor Author

https://github.com/apache/iceberg/blob/c7910bb401f7f7fd09010bede0d80f5d2164afd5/core/src/main/java/org/apache/iceberg/MetadataUpdateParser.java#L547

This is a hard limit in the server implementation. I am not sure about the reason for this design, as I am not familiar enough with the specification of iceberg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant