[ 
https://issues.apache.org/jira/browse/BEAM-13293?focusedWorklogId=692796&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-692796
 ]

ASF GitHub Bot logged work on BEAM-13293:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Dec/21 18:46
            Start Date: 08/Dec/21 18:46
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on a change in pull request #16111:
URL: https://github.com/apache/beam/pull/16111#discussion_r765139544



##########
File path: sdks/go/test/integration/io/xlang/jdbc/jdbc.go
##########
@@ -0,0 +1,62 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Package jdbc contains integration tests for cross-language JDBC IO 
transforms.
+
+package jdbc
+
+import (
+       "reflect"
+
+       "github.com/apache/beam/sdks/v2/go/pkg/beam"
+       "github.com/apache/beam/sdks/v2/go/pkg/beam/io/xlang/jdbcio"
+)
+
+func init() {
+       beam.RegisterType(reflect.TypeOf((*JdbcWriteTestRow)(nil)).Elem())
+}
+
+type JdbcWriteTestRow struct {
+       F_id string `beam:F_id`
+}
+
+// writeList encodes a list of ints and sends encoded ints to Kafka.
+func writeRows(s beam.Scope, expansionAddr, tableName, driverClassName, 
jdbcUrl, username, password string, rows beam.PCollection) {
+       s = s.Scope("jdbc_test.WriteToJdbc")
+       jdbcio.Write(s, expansionAddr, tableName, driverClassName, jdbcUrl, 
username, password, rows) //, jdbcio.WriteStatement(statement))
+}
+
+// WritePipeline creates a pipeline that writes a given slice of ints to Kafka.
+func WritePipeline(expansionAddr, tableName, driverClassName, jdbcUrl, 
username, password string) *beam.Pipeline {
+       beam.Init()
+       p, s := beam.NewPipelineWithRoot()
+       rows := []JdbcWriteTestRow{{"row1"}, {"row2"}}
+
+       writeRows(s, expansionAddr, tableName, driverClassName, jdbcUrl, 
username, password, beam.Create(s, rows))

Review comment:
       The following should resolve the coder issue in 
https://issues.apache.org/jira/browse/BEAM-13418
   
   ```suggestion
        input :=  beam.CreateList(s, rows)
        writeRows(s, expansionAddr, tableName, driverClassName, jdbcUrl, 
username, password, input)
   ```




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 692796)
    Time Spent: 2h  (was: 1h 50m)

> Go SDK JDBC IO XLang Transform
> ------------------------------
>
>                 Key: BEAM-13293
>                 URL: https://issues.apache.org/jira/browse/BEAM-13293
>             Project: Beam
>          Issue Type: New Feature
>          Components: cross-language, sdk-go
>            Reporter: Ritesh Ghorse
>            Assignee: Ritesh Ghorse
>            Priority: P2
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Add a cross language transform support in Go SDK for JDBC IO.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to