yasser-chihab opened a new issue, #30040:
URL: https://github.com/apache/beam/issues/30040

   ### What happened?
   
   We are trying to run a Go based **apache beam sdk 2.53** pipeline on 
Dataflow, we try to use SqlTransform, but unfortunately It throws the following 
error 
   ```
   Error: Unable to initialize main class org.apache.beam.fn.harness.FnHarness
   Caused by: java.lang.NoClassDefFoundError: 
org/apache/beam/vendor/grpc/v1p54p0/io/grpc/Channel
   ```
   
   
   our piplie code is the following 
   
   ```
   package main
   
   import (
        "context"
        "flag"
        "fmt"
        "reflect"
        "strings"
        "time"
   
        "github.com/apache/beam/sdks/v2/go/pkg/beam"
        "github.com/apache/beam/sdks/v2/go/pkg/beam/io/bigqueryio"
        "github.com/apache/beam/sdks/v2/go/pkg/beam/log"
        "github.com/apache/beam/sdks/v2/go/pkg/beam/transforms/sql"
        "github.com/apache/beam/sdks/v2/go/pkg/beam/x/beamx"
   )
   
   type Workspace struct {
        WorkspaceId string
   }
   
   type BqRow struct {
        Date      string
        Line      string
        WordCount int64
   }
   func Init() {
        beam.RegisterType(reflect.TypeOf((*Workspace)(nil)))
   
   }
   
   func main() {
        ctx := context.Background()
        flag.Set("runner", "dataflow")
        flag.Set("project", gcpProject)
        flag.Set("region", "us-east1")
        flag.Set("staging_location", "gs://stream-words/binaries")
        flag.Set("runner", "DirectRunner")
   
        flag.Parse()
        beam.Init()
   
        // Create the Pipeline object and root scope.
        pipeline, scope := beam.NewPipelineWithRoot()
   
        in := beam.Create(scope,
                Workspace{WorkspaceId: "ws1"},
                Workspace{WorkspaceId: "ws2"},
                Workspace{WorkspaceId: "ws3"},
                Workspace{WorkspaceId: "ws4"},
                Workspace{WorkspaceId: "ws5"},
                Workspace{WorkspaceId: "ws2"},
                Workspace{WorkspaceId: "ws3"},
                Workspace{WorkspaceId: "ws4"},
        )
   
        fmt.Println("=======> ", in.Coder())
   
        out := sql.Transform(scope, "SELECT COUNT(*) FROM PCOLLECTION",
                sql.Input("t", in),
                sql.OutputType(reflect.TypeOf(int64(0))),
                sql.Dialect("calcite"),
        )
   
        writeToBQ(scope, *bigqueryDataset, out)
   
        // Run the beam pipeline
        if err := beamx.Run(ctx, pipeline); err != nil {
                log.Exitf(ctx, "Failed to execute job: %v", err)
        }
   }
   
   ```
   Do we miss anything here that can cause the issue ?
   
   ### Issue Priority
   
   Priority: 3 (minor)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [ ] Component: Java SDK
   - [X] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [X] Component: Google Cloud Dataflow Runner


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to