You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/09 02:58:50 UTC

[GitHub] [spark] viirya opened a new pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

viirya opened a new pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851
 
 
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   When encoding Java Beans to Spark DataFrame, respecting `javax.annotation.Nonnull` and producing non-null fields.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   When encoding Java Beans to Spark DataFrame, non-primitive types are encoded as nullable fields. Although It works for most cases, it can be an issue under a few situations, e.g. the one described in the JIRA ticket when saving DataFrame to Avro format with non-null field.
   
   We should allow Spark users more flexibility when creating Spark DataFrame from Java Beans. Currently, Spark users cannot create DataFrame with non-nullable fields in the schema from beans with non-nullable properties.
   
   Although it is possible to project top-level columns with SQL expressions like `AssertNotNull` to make it non-null, for nested fields it is more tricky to do it similarly.
   
   ### Does this PR introduce any user-facing change?
   <!--
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If no, write 'No'.
   -->
   
   Yes. After this change, Spark users can use `javax.annotation.Nonnull` to annotate non-null fields in Java Beans when encoding beans to Spark DataFrame.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   
   Added unit test.
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851
 
 
   

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596935726
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119602/
   Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596918835
 
 
   **[Test build #119602 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119602/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365400
 
 
   retest this please

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365597
 
 
   **[Test build #119554 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119554/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596362746
 
 
   Merged build finished. Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310448
 
 
   **[Test build #119549 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119549/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310677
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24281/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r390148013
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java
 ##########
 @@ -1504,6 +1574,54 @@ public void testSerializeNull() {
     Assert.assertEquals(beans, ds2.collectAsList());
   }
 
+  @Test
+  public void testNonNullField() {
+    NestedSmallBeanWithNonNullField bean1 = new NestedSmallBeanWithNonNullField();
+    SmallBean smallBean = new SmallBean();
+    bean1.setNonNull_f(smallBean);
+    Map<String, SmallBean> map = new HashMap<>();
+    bean1.setChildMap(map);
+
+    Encoder<NestedSmallBeanWithNonNullField> encoder1 =
+            Encoders.bean(NestedSmallBeanWithNonNullField.class);
+    List<NestedSmallBeanWithNonNullField> beans1 = Arrays.asList(bean1);
+    Dataset<NestedSmallBeanWithNonNullField> ds1 = spark.createDataset(beans1, encoder1);
+
+    StructType schema = ds1.schema();
+    Assert.assertFalse(schema.fields()[schema.fieldIndex("nonNull_f")].nullable());
 
 Review comment:
   yes, that is better. changed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389503356
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java
 ##########
 @@ -823,6 +824,75 @@ public int hashCode() {
     }
   }
 
+  public static class NestedSmallBeanWithNonNullField implements Serializable {
+    private SmallBean nonNull_f;
+    private SmallBean nullable_f;
+    private Map<String, SmallBean> childMap;
+
+    @Nonnull
+    public SmallBean getNonNull_f() {
+      return nonNull_f;
+    }
+
+    public void setNonNull_f(SmallBean f) {
+      this.nonNull_f = f;
+    }
+
+    public SmallBean getNullable_f() {
+      return nullable_f;
+    }
+
+    public void setNullable_f(SmallBean f) {
+      this.nullable_f = f;
+    }
+
+    @Nonnull
+    public Map<String, SmallBean> getChildMap() { return childMap; }
+    public void setChildMap(Map<String, SmallBean> childMap) {
+      this.childMap = childMap;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+      NestedSmallBeanWithNonNullField that = (NestedSmallBeanWithNonNullField) o;
+      return Objects.equal(nullable_f, that.nullable_f) &&
+        Objects.equal(nonNull_f, that.nonNull_f) && Objects.equal(childMap, that.childMap);
+    }
+
+    @Override
+    public int hashCode() {
+      return Objects.hashCode(nullable_f, nonNull_f, childMap);
+    }
+  }
+
+  public static class NestedSmallBean2 implements Serializable {
 
 Review comment:
   is this necessary? It's just testing another non-nullable jave bean.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310673
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389942788
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java
 ##########
 @@ -823,6 +824,75 @@ public int hashCode() {
     }
   }
 
+  public static class NestedSmallBeanWithNonNullField implements Serializable {
+    private SmallBean nonNull_f;
+    private SmallBean nullable_f;
+    private Map<String, SmallBean> childMap;
+
+    @Nonnull
+    public SmallBean getNonNull_f() {
+      return nonNull_f;
+    }
+
+    public void setNonNull_f(SmallBean f) {
+      this.nonNull_f = f;
+    }
+
+    public SmallBean getNullable_f() {
+      return nullable_f;
+    }
+
+    public void setNullable_f(SmallBean f) {
+      this.nullable_f = f;
+    }
+
+    @Nonnull
+    public Map<String, SmallBean> getChildMap() { return childMap; }
+    public void setChildMap(Map<String, SmallBean> childMap) {
+      this.childMap = childMap;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+      NestedSmallBeanWithNonNullField that = (NestedSmallBeanWithNonNullField) o;
+      return Objects.equal(nullable_f, that.nullable_f) &&
+        Objects.equal(nonNull_f, that.nonNull_f) && Objects.equal(childMap, that.childMap);
+    }
+
+    @Override
+    public int hashCode() {
+      return Objects.hashCode(nullable_f, nonNull_f, childMap);
+    }
+  }
+
+  public static class NestedSmallBean2 implements Serializable {
 
 Review comment:
   Yea, basically I want to cover the nested field case.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596957201
 
 
   retest this please

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389892541
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java
 ##########
 @@ -823,6 +824,75 @@ public int hashCode() {
     }
   }
 
+  public static class NestedSmallBeanWithNonNullField implements Serializable {
+    private SmallBean nonNull_f;
+    private SmallBean nullable_f;
+    private Map<String, SmallBean> childMap;
+
+    @Nonnull
+    public SmallBean getNonNull_f() {
+      return nonNull_f;
+    }
+
+    public void setNonNull_f(SmallBean f) {
+      this.nonNull_f = f;
+    }
+
+    public SmallBean getNullable_f() {
+      return nullable_f;
+    }
+
+    public void setNullable_f(SmallBean f) {
+      this.nullable_f = f;
+    }
+
+    @Nonnull
+    public Map<String, SmallBean> getChildMap() { return childMap; }
+    public void setChildMap(Map<String, SmallBean> childMap) {
+      this.childMap = childMap;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+      NestedSmallBeanWithNonNullField that = (NestedSmallBeanWithNonNullField) o;
+      return Objects.equal(nullable_f, that.nullable_f) &&
+        Objects.equal(nonNull_f, that.nonNull_f) && Objects.equal(childMap, that.childMap);
+    }
+
+    @Override
+    public int hashCode() {
+      return Objects.hashCode(nullable_f, nonNull_f, childMap);
+    }
+  }
+
+  public static class NestedSmallBean2 implements Serializable {
 
 Review comment:
   He may want to emulate a nested class hierarchy because `NestedSmallBeanWithNonNullField` is a field of `NestedSmallBean2`.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597069490
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365991
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24286/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958960
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596481849
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596362271
 
 
   **[Test build #119549 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119549/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds no public classes.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958508
 
 
   **[Test build #119611 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119611/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597069490
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310677
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24281/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] kyrill007 commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
kyrill007 commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597613802
 
 
   Would it be possible to support annotation on Fields as well? Currently it is just on read methods.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597555207
 
 
   thanks, merging to master!

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365984
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596362750
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119549/
   Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389890911
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala
 ##########
 @@ -203,6 +203,7 @@ case class ExpressionEncoder[T](
       }
       nullSafeSerializer match {
         case If(_: IsNull, _, s: CreateNamedStruct) => s
+        case s: CreateNamedStruct => s
 
 Review comment:
   Is this required only in this PR?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596481858
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119554/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596935724
 
 
   Merged build finished. Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310448
 
 
   **[Test build #119549 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119549/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596935638
 
 
   **[Test build #119602 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119602/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).
    * This patch **fails due to an unknown error code, -9**.
    * This patch merges cleanly.
    * This patch adds no public classes.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597068727
 
 
   **[Test build #119611 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119611/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596935724
 
 
   Merged build finished. Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596919305
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24332/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597069506
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119611/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-597069506
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119611/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r390107200
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala
 ##########
 @@ -203,6 +203,7 @@ case class ExpressionEncoder[T](
       }
       nullSafeSerializer match {
         case If(_: IsNull, _, s: CreateNamedStruct) => s
+        case s: CreateNamedStruct => s
 
 Review comment:
   This change is due to the change at `createSerializerForObject`. 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r390107102
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SerializerBuildHelper.scala
 ##########
 @@ -187,8 +187,12 @@ object SerializerBuildHelper {
     val nonNullOutput = CreateNamedStruct(fields.flatMap { case(fieldName, fieldExpr) =>
       argumentsForFieldSerializer(fieldName, fieldExpr)
     })
-    val nullOutput = expressions.Literal.create(null, nonNullOutput.dataType)
-    expressions.If(IsNull(inputObject), nullOutput, nonNullOutput)
+    if (inputObject.nullable) {
+      val nullOutput = expressions.Literal.create(null, nonNullOutput.dataType)
+      expressions.If(IsNull(inputObject), nullOutput, nonNullOutput)
 
 Review comment:
   In `createDataset`, we use the `schema` of current encoder to be the output of `LocalRelation`. So the output schema is kept to be nullable.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596935726
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119602/
   Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958969
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24340/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958960
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
viirya commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596309663
 
 
   cc @cloud-fan @dongjoon-hyun @HyukjinKwon About this change, WDYT?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596362746
 
 
   Merged build finished. Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389501410
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SerializerBuildHelper.scala
 ##########
 @@ -187,8 +187,12 @@ object SerializerBuildHelper {
     val nonNullOutput = CreateNamedStruct(fields.flatMap { case(fieldName, fieldExpr) =>
       argumentsForFieldSerializer(fieldName, fieldExpr)
     })
-    val nullOutput = expressions.Literal.create(null, nonNullOutput.dataType)
-    expressions.If(IsNull(inputObject), nullOutput, nonNullOutput)
+    if (inputObject.nullable) {
+      val nullOutput = expressions.Literal.create(null, nonNullOutput.dataType)
+      expressions.If(IsNull(inputObject), nullOutput, nonNullOutput)
 
 Review comment:
   I think optimizer can optimize `IsNull(inputObject)` if `inputObject` is not nullable?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365991
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24286/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596919295
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596919295
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596310673
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365597
 
 
   **[Test build #119554 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119554/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958508
 
 
   **[Test build #119611 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119611/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596481858
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119554/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596362750
 
 
   Test FAILed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119549/
   Test FAILed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596365984
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596958969
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24340/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596481849
 
 
   Merged build finished. Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596918835
 
 
   **[Test build #119602 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119602/testReport)** for PR 27851 at commit [`5a5345e`](https://github.com/apache/spark/commit/5a5345e8a203a44220f1580d3e7caa1448101ae6).

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596919305
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24332/
   Test PASSed.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#discussion_r389503047
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java
 ##########
 @@ -1504,6 +1574,54 @@ public void testSerializeNull() {
     Assert.assertEquals(beans, ds2.collectAsList());
   }
 
+  @Test
+  public void testNonNullField() {
+    NestedSmallBeanWithNonNullField bean1 = new NestedSmallBeanWithNonNullField();
+    SmallBean smallBean = new SmallBean();
+    bean1.setNonNull_f(smallBean);
+    Map<String, SmallBean> map = new HashMap<>();
+    bean1.setChildMap(map);
+
+    Encoder<NestedSmallBeanWithNonNullField> encoder1 =
+            Encoders.bean(NestedSmallBeanWithNonNullField.class);
+    List<NestedSmallBeanWithNonNullField> beans1 = Arrays.asList(bean1);
+    Dataset<NestedSmallBeanWithNonNullField> ds1 = spark.createDataset(beans1, encoder1);
+
+    StructType schema = ds1.schema();
+    Assert.assertFalse(schema.fields()[schema.fieldIndex("nonNull_f")].nullable());
 
 Review comment:
   how about `schema.apply("nonNull_f").nullable()`?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27851: [SPARK-31071][SQL] Allow annotating non-null fields when encoding Java Beans
URL: https://github.com/apache/spark/pull/27851#issuecomment-596481046
 
 
   **[Test build #119554 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119554/testReport)** for PR 27851 at commit [`efddb6e`](https://github.com/apache/spark/commit/efddb6e14ceaf79d6109053ca0315feae55bae41).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org