You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/12 06:46:12 UTC

[GitHub] [iceberg] simonsssu opened a new pull request #2074: Add comments for Position2Accessor and Position3Accessor

simonsssu opened a new pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074


   We need some comments to explain the purpose here. otherwise it's a bit hard to understand.


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

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


[GitHub] [iceberg] rdblue merged pull request #2074: Add comments for Position2Accessor and Position3Accessor

Posted by GitBox <gi...@apache.org>.
rdblue merged pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074


   


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

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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2074: Add comments for Position2Accessor and Position3Accessor

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074#discussion_r556185865



##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -76,6 +76,20 @@ public String toString() {
     }
   }
 
+  /**

Review comment:
       Since you are describing both Position2Accessor and Position3Accessor, I think it makes more sense to move this documentation up to the `public class Accessors`, so that javadoc can be generated.

##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -76,6 +76,20 @@ public String toString() {
     }
   }
 
+  /**
+   * Position2Accessor and Position3Accessor here is an optimization. For a nested schema like:
+   *
+   * root
+   *  |-- a: struct (nullable = false)
+   *  |    |-- b: struct (nullable = false)
+   *  |        | -- c: string (containsNull = false)
+   *
+   *  Then we will use Position3Accessor to access nested field 'c'. It can be accessed by call
+   *  row.get(p0, StructLike.class).get(p1, StructLike.class).get(p2, javaClass) directly.
+   *  Commonly, Nested fields with depth=1 or 2 or 3 are the fields that will be accessed frequently, so this

Review comment:
       nit: change line after `,` or `.`, same comment also for the next 2 lines.

##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -76,6 +76,20 @@ public String toString() {
     }
   }
 
+  /**
+   * Position2Accessor and Position3Accessor here is an optimization. For a nested schema like:
+   *
+   * root
+   *  |-- a: struct (nullable = false)
+   *  |    |-- b: struct (nullable = false)
+   *  |        | -- c: string (containsNull = false)
+   *
+   *  Then we will use Position3Accessor to access nested field 'c'. It can be accessed by call
+   *  row.get(p0, StructLike.class).get(p1, StructLike.class).get(p2, javaClass) directly.

Review comment:
       nit: make this in `{@code}` or `<pre></pre>` block.




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

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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2074: Add comments for Position2Accessor and Position3Accessor

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074#discussion_r556296067



##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -26,6 +26,21 @@
 import org.apache.iceberg.types.TypeUtil;
 import org.apache.iceberg.types.Types;
 
+
+/**
+ * Position2Accessor and Position3Accessor here is an optimization. For a nested schema like:
+ *
+ * root
+ *  |-- a: struct (nullable = false)
+ *  |    |-- b: struct (nullable = false)
+ *  |        | -- c: string (containsNull = false)
+ *
+ *  Then we will use Position3Accessor to access nested field 'c'. It can be accessed like this:
+ *  {@code row.get(p0, StructLike.class).get(p1, StructLike.class).get(p2, javaClass).

Review comment:
       `}` is missing in the end.




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

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


[GitHub] [iceberg] jackye1995 commented on a change in pull request #2074: Add comments for Position2Accessor and Position3Accessor

Posted by GitBox <gi...@apache.org>.
jackye1995 commented on a change in pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074#discussion_r556789672



##########
File path: api/src/main/java/org/apache/iceberg/Accessors.java
##########
@@ -26,6 +26,20 @@
 import org.apache.iceberg.types.TypeUtil;
 import org.apache.iceberg.types.Types;
 
+/**
+ * Position2Accessor and Position3Accessor here is an optimization. For a nested schema like:
+ *
+ * root

Review comment:
       thank you very much for the update, sorry for the back and forth, just one last thing: the example block here needs to be in `<pre></pre>`, otherwise they will collapse.




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

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


[GitHub] [iceberg] rdblue commented on pull request #2074: Add comments for Position2Accessor and Position3Accessor

Posted by GitBox <gi...@apache.org>.
rdblue commented on pull request #2074:
URL: https://github.com/apache/iceberg/pull/2074#issuecomment-761291887


   Thanks @simonsssu and @jackye1995!


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

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