beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From echauc...@apache.org
Subject [beam] 06/37: Fix scala Product in Encoders to avoid StackEverflow
Date Thu, 24 Oct 2019 10:21:14 GMT
This is an automated email from the ASF dual-hosted git repository.

echauchot pushed a commit to branch spark-runner_structured-streaming
in repository https://gitbox.apache.org/repos/asf/beam.git

commit fff509246b4ed9810c137ba2c9bd7811e3d95079
Author: Etienne Chauchot <echauchot@apache.org>
AuthorDate: Thu Aug 29 10:58:32 2019 +0200

    Fix scala Product in Encoders to avoid StackEverflow
---
 .../translation/helpers/EncoderHelpers.java            | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/helpers/EncoderHelpers.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/helpers/EncoderHelpers.java
index 9cb8f29..8a4f1de 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/helpers/EncoderHelpers.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/structuredstreaming/translation/helpers/EncoderHelpers.java
@@ -175,16 +175,11 @@ public class EncoderHelpers {
     }
 
     @Override public Object productElement(int n) {
-      if (n == 0) {
-        return this;
-      } else {
-        throw new IndexOutOfBoundsException(String.valueOf(n));
-      }
+      return null;
     }
 
     @Override public int productArity() {
-      //TODO test with spark Encoders if the arity of 1 is ok
-      return 1;
+      return 0;
     }
 
     @Override public boolean canEqual(Object that) {
@@ -291,16 +286,11 @@ public class EncoderHelpers {
     }
 
     @Override public Object productElement(int n) {
-      if (n == 0) {
-        return this;
-      } else {
-        throw new IndexOutOfBoundsException(String.valueOf(n));
-      }
+      return null;
     }
 
     @Override public int productArity() {
-      //TODO test with spark Encoders if the arity of 1 is ok
-      return 1;
+      return 0;
     }
 
     @Override public boolean canEqual(Object that) {


Mime
View raw message