You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "petrkotek (via GitHub)" <gi...@apache.org> on 2024/05/11 01:42:55 UTC

Re: [I] Support recursive structs as concrete types in Go SDK [beam]

petrkotek commented on issue #18846:
URL: https://github.com/apache/beam/issues/18846#issuecomment-2105438498

   +1.
   
   I've run into this issue when trying to use `geojson.Feature` (https://github.com/paulmach/go.geojson/blob/master/feature.go) in the pipeline.
   
   This doesn't work as the `geojson.Geometry` [is recursive](https://github.com/paulmach/go.geojson/blob/master/geometry.go#L34).
   
   Stack trace (for discoverability):
   
   ```
   runtime: goroutine stack exceeds 1000000000-byte limit
   runtime: sp=0xc03f4003b8 stack=[0xc03f400000, 0xc05f400000]
   fatal error: stack overflow
   
   runtime stack:
   runtime.throw({0x6f2cfc4?, 0x70000abcddd8?})
   	/usr/local/Cellar/go/1.22.0/libexec/src/runtime/panic.go:1023 +0x5c fp=0x70000abcdd88 sp=0x70000abcdd58 pc=0x5ce609c
   runtime.newstack()
   	/usr/local/Cellar/go/1.22.0/libexec/src/runtime/stack.go:1103 +0x5bd fp=0x70000abcdf38 sp=0x70000abcdd88 pc=0x5d01fdd
   runtime.morestack()
   	/usr/local/Cellar/go/1.22.0/libexec/src/runtime/asm_amd64.s:616 +0x7a fp=0x70000abcdf40 sp=0x70000abcdf38 pc=0x5d1f0ba
   
   goroutine 1 gp=0xc0000061c0 m=10 mp=0xc000700008 [running]:
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).logicalTypeToFieldType(0x9297c20, {0x7a7e148, 0x7241420})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:330 +0x4fa fp=0xc03f4003c8 sp=0xc03f4003c0 pc=0x621329a
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).reflectTypeToFieldType(0x9297c20, {0x7a7e148, 0x7241420})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:569 +0x37 fp=0xc03f4004a8 sp=0xc03f4003c8 pc=0x6214c97
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).logicalTypeToFieldType(0x9297c20, {0x7a7e148, 0x72412e0})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:335 +0xd9 fp=0xc03f400620 sp=0xc03f4004a8 pc=0x6212e79
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).reflectTypeToFieldType(0x9297c20, {0x7a7e148, 0x72412e0})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:569 +0x37 fp=0xc03f400700 sp=0xc03f400620 pc=0x6214c97
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).structFieldToField(0x9297c20, {{0x710f910, 0x4}, {0x0, 0x0}, {0x7a7e148, 0x72412e0}, {0x710f915, 0xb}, 0x0, ...})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:558 +0x8b fp=0xc03f400748 sp=0xc03f400700 pc=0x6214bcb
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).structToSchema(0x9297c20, {0x7a7e148, 0x77c6660})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:533 +0x627 fp=0xc03f400968 sp=0xc03f400748 pc=0x62145c7
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).reflectTypeToFieldType(0x9297c20, {0x7a7e148, 0x77c6660})
   	/Users/petrkotek/go/pkg/mod/github.com/apache/beam/sdks/v2@v2.56.0/go/pkg/beam/core/runtime/graphx/schema/schema.go:612 +0x52b fp=0xc03f400a48 sp=0xc03f400968 pc=0x621518b
   github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/graphx/schema.(*Registry).reflectTypeToFieldType(0x9297c20, {0x7a7e148, 0x76a8a60})
   (... and much more ...)
   ```


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org