You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2024/12/14 10:20:11 UTC

[PR] feat: Store file io props to allow re-build it [iceberg-rust]

Xuanwo opened a new pull request, #802:
URL: https://github.com/apache/iceberg-rust/pull/802

   This PR will store file io props to allow users to re-build it.
   
   This PR will partly address https://github.com/apache/iceberg-rust/issues/791
   
   ---
   
   In a distributed system, we need to fetch table metadata, plan tasks, and distribute these tasks to different nodes. Each node will reconstruct the table instances to perform I/O while receiving a task. By storing file I/O properties, we can rebuild the `Table` without repeatedly fetching all the metadata from the catalog. This approach helps reduce the large number of catalog requests, especially when there are many workers.


-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1886929988


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   What's the goal of the `scheme_str`? If we want to have a specific impl, we could also pass that into the configuration itself. This is of course bound to a language, [for example `py-io-impl`](https://py.iceberg.apache.org/configuration/#fileio) and in Java it is just `io-impl`.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1887055534


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   > What's the goal of the `scheme_str`? If we want to have a specific impl, we could also pass that into the configuration itself. This is of course bound to a language, [for example `py-io-impl`](https://py.iceberg.apache.org/configuration/#fileio) and in Java it is just `io-impl`.
   
   Makes sense to me.
   
   I exposed the necessary elements as they are to build `FileIO`. I can address this in another PR that removes the requirement for `scheme` to build `FileIO`.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1885062127


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   Should we really expose this? Why not just derive `Serialize`/`Deserialize` for `FileIOBuilder`?



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1887055534


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   > What's the goal of the `scheme_str`? If we want to have a specific impl, we could also pass that into the configuration itself. This is of course bound to a language, [for example `py-io-impl`](https://py.iceberg.apache.org/configuration/#fileio) and in Java it is just `io-impl`.
   
   Makes sense to me.
   
   I exposed the necessary elements as they are to build `FileIO` for now. I can address this in another PR that removes the requirement for `scheme` to build `FileIO`.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1885057726


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -43,10 +43,21 @@ use crate::{Error, ErrorKind, Result};
 /// | GCS                | `storage-gcs`     | `gcs`       |
 #[derive(Clone, Debug)]
 pub struct FileIO {
+    scheme: String,

Review Comment:
   Oh, I got your idea: you mean store `FileIOBuilder` directly instead `(String, HashMap<String, String>)`. Seems nice, I will take a try.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1887835700


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   > Implementing Serialize or Deserialize for FileIOBuilder could lead to users relying on it directly.
   
   That's exactly what I want. But user are not supposed to depend on the serialized format, but only the ser/de api provided by this library. The pros of this approach is that we don't need to expose internals fields to user, but only apis.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 merged PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802


-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1885054492


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -43,10 +43,21 @@ use crate::{Error, ErrorKind, Result};
 /// | GCS                | `storage-gcs`     | `gcs`       |
 #[derive(Clone, Debug)]
 pub struct FileIO {
+    scheme: String,

Review Comment:
   Instead of storing them, how about we make `FileIOBuilder` clone and serializable? This could avoid exposing internals and reuse everything there.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1887841721


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   > But user are not supposed to depend on the serialized format, but only the ser/de api provided by this library.
   
   Providing ser/de is a contract I don't want to establish with users. It implies a promise that users can deserialize the file I/O back at any time after serialization. Once we expose ser/de, users will inevitably try to use it in ways we never anticipated, such as storing it in a metadata service or transferring it between clusters.
   
   There should be a much broader discussion about how we should handle serialization/deserialization across our project. Similar issues could occur in https://github.com/apache/iceberg-rust/issues/774. However, I don't want to initiate that discussion here.
   
   In my opinion, making an API-breaking change is much better than offering serialization/deserialization but breaking it unexpectedly.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1885057244


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -43,10 +43,21 @@ use crate::{Error, ErrorKind, Result};
 /// | GCS                | `storage-gcs`     | `gcs`       |
 #[derive(Clone, Debug)]
 pub struct FileIO {
+    scheme: String,

Review Comment:
   > Instead of storing them, how about we make `FileIOBuilder` clone and serializable? This could avoid exposing internals and reuse everything there.
   
   Hi, there is no way for us to get a `FileIOBuilder` from existing `Table` instance.



-- 
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] feat: Store file io props to allow re-build it [iceberg-rust]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #802:
URL: https://github.com/apache/iceberg-rust/pull/802#discussion_r1885088981


##########
crates/iceberg/src/io/file_io.rs:
##########
@@ -165,7 +175,7 @@ impl FileIOBuilder {
     /// Fetch the scheme string.
     ///
     /// The scheme_str will be empty if it's None.
-    pub(crate) fn into_parts(self) -> (String, HashMap<String, String>) {
+    pub fn into_parts(self) -> (String, HashMap<String, String>) {

Review Comment:
   > Should we really expose this? Why not just derive `Serialize`/`Deserialize` for `FileIOBuilder`?
   
   Unlike `TableMetadata`, `FileIOBuilder` does not have a predefined struct layout. Implementing `Serialize` or `Deserialize` for `FileIOBuilder` could lead to users relying on it directly. By exposing `into_parts`, we give users the flexibility to make their own decisions. This approach also allows us to modify the API and adjust the internal layout in the future by changing the API directly without unintentionally breaking users' applications.



-- 
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