singhpk234 opened a new pull request, #13191: URL: https://github.com/apache/iceberg/pull/13191
### About the change Presently the REST parsers are stateless aka static, this makes hard to inject a state which can help the parser to construct the response object if it needs some prior info. Addding injectable values to the mapper and using a reader with injectable value passed during making the request will make sure that during deserialization we will get back the value injected from the DeserializationContext https://github.com/apache/iceberg/blob/3469cf30f2d839763813596e3f0c66ed16189c9a/core/src/main/java/org/apache/iceberg/rest/RESTSerializers.java#L450 essentially something like this is possible now : ``` // Retrieve injectable values @SuppressWarnings("unchecked") Map<Integer, PartitionSpec> specsById = (Map<Integer, PartitionSpec>) context.findInjectableValue("specsById", null, null); boolean caseSensitive = (boolean) context.findInjectableValue("caseSensitive", null, null); ``` so now a client can essentially during making the post can pass the injectableValues and use it for stateful parsing i,e making these value available to the parser while doing deserilization. ### Why this is required This is required because of scan planning API response doesn't contains specs the caseSensitive field which is required for properly creating the FileScanTask / DataFile / DeleteFile objects essentially needing the state where the table has been loaded and we have already the specByID map and the caseSensitive field. Now these can be injected and percolated from the POST call to all the way to the mapper and hence to the parsers to make the cycle. My understanding is Since we do it this way rather than injecting the whole at mapper end, we can guarantee thread safety ref scan planning PR : https://github.com/apache/iceberg/pull/13004/ for E2E machinery -- 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