[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #1046: ISSUE-189: Add support for union record type

2020-05-26 Thread GitBox


rdsr commented on a change in pull request #1046:
URL: https://github.com/apache/incubator-iceberg/pull/1046#discussion_r430588847



##
File path: api/src/main/java/org/apache/iceberg/types/Types.java
##
@@ -526,25 +526,25 @@ public static StructType of(List fields) {
   return new StructType(fields, false);
 }
 
-public static StructType of(List fields, boolean 
isUnionSchema) {
-  return new StructType(fields, isUnionSchema);
+public static StructType of(List fields, boolean 
convertedFromUnionSchema) {
+  return new StructType(fields, convertedFromUnionSchema);

Review comment:
   + 1. We shouldn't support writing unions.

##
File path: api/src/main/java/org/apache/iceberg/types/Types.java
##
@@ -526,25 +526,25 @@ public static StructType of(List fields) {
   return new StructType(fields, false);
 }
 
-public static StructType of(List fields, boolean 
isUnionSchema) {
-  return new StructType(fields, isUnionSchema);
+public static StructType of(List fields, boolean 
convertedFromUnionSchema) {
+  return new StructType(fields, convertedFromUnionSchema);

Review comment:
   +1 We shouldn't support writing unions.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org



[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #1046: ISSUE-189: Add support for union record type

2020-05-21 Thread GitBox


rdsr commented on a change in pull request #1046:
URL: https://github.com/apache/incubator-iceberg/pull/1046#discussion_r428681937



##
File path: api/src/main/java/org/apache/iceberg/types/Types.java
##
@@ -641,6 +650,13 @@ public int hashCode() {
   }
   return fieldsById;
 }
+
+/**
+ * @return true if struct represents union schema
+ */
+public boolean isUnionSchema() {

Review comment:
   Why do we need this in the main API?  The API should not expose unions 
or info about union IMO.





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:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org



[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #1046: ISSUE-189: Add support for union record type

2020-05-21 Thread GitBox


rdsr commented on a change in pull request #1046:
URL: https://github.com/apache/incubator-iceberg/pull/1046#discussion_r428681937



##
File path: api/src/main/java/org/apache/iceberg/types/Types.java
##
@@ -641,6 +650,13 @@ public int hashCode() {
   }
   return fieldsById;
 }
+
+/**
+ * @return true if struct represents union schema
+ */
+public boolean isUnionSchema() {

Review comment:
   Why do we need this in the main API?  The API should not expose unions 
or info about union. Can't we do the translation in during data reading?
   Both Avro and ORC will take read schemas. IMO if the underlying file schema 
contains a union and the read schema contains a struct for the same field, the 
translation should happen 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.

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



[GitHub] [incubator-iceberg] rdsr commented on a change in pull request #1046: ISSUE-189: Add support for union record type

2020-05-21 Thread GitBox


rdsr commented on a change in pull request #1046:
URL: https://github.com/apache/incubator-iceberg/pull/1046#discussion_r428681937



##
File path: api/src/main/java/org/apache/iceberg/types/Types.java
##
@@ -641,6 +650,13 @@ public int hashCode() {
   }
   return fieldsById;
 }
+
+/**
+ * @return true if struct represents union schema
+ */
+public boolean isUnionSchema() {

Review comment:
   Why do we need this in the main API?  The API should not expose unions 
or info about union. Can't we do the translation in during data reading?
   Both Avro and ORC will take read schemas. IMO if the underlying file schema 
is a union and the read schema is a struct, the translation should happen 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.

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