-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protos with recursive fields fail with stack overflow #5
Comments
@drewrobb, were you able to find a resolution for this? We are facing what looks like a similar issue with a highly nested schema |
@dbkegley we have not found a resolution to this, nor even have a proposed way to fix it |
Schemas in Spark must be known ahead of time. A possible workaround would be to set a limit on the recursion depth when generating a schema. Would that be useful? |
That sounds like it would fix my use case. We aren't storing arbitrarily deep trees or anything-- mostly just single level recursion like in the example in this issue. |
FWIW, for a single level, you could do something like this:
The downside is that this pushes the parent Person to a field, rather than in the top level. One way to get around this is to have an implicit conversion between |
@thesamet I think this would work for us as well. Unfortunately we only consume so don't have access to update the schema. We can advise against recursive fields but there's no guarantee the producers will follow our recommendation |
@thesamet, I'm in the same boat where I, as a consumer, cannot control the source. It would be great if the ProtoSQL driver could have a recursion-depth limit/parameter. As a workaround, I'm looking into a way to flatten this out before it hits Spark. The recursion is maximum 10 deep if that helps. I'm using Scala 2.11.12, Spark 2.4.4, sparksql-scalapb 0.9.2, sbt-protoc 0.99.28, scalapb compilerplugin 0.9.7. |
just wandering if this issue was addressed in the newer release of scalapb? We are facing a similar issue. |
Hi @anjshrg , the issue is still not resolved. PRs will be welcome! |
I found the same issue using the Protobuf field type google.protobuf.Struct. This field type contains nested Struct types, therefore I've got a StackOverflow error. Any idea on how to tackle this issue when we can't control the schema? |
Adding a recursive field to a proto breaks things, see drewrobb/sparksql-scalapb-test@4cfc436 for a reproduction. I'm happy to help address this if you have a recommended approach to solving it?
The text was updated successfully, but these errors were encountered: