[ 
https://issues.apache.org/jira/browse/ARROW-2348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16412972#comment-16412972
 ] 

ASF GitHub Bot commented on ARROW-2348:
---------------------------------------

xhochy closed pull request #1785: ARROW-2348: [GLib] Remove GLib + Go example
URL: https://github.com/apache/arrow/pull/1785
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/c_glib/README.md b/c_glib/README.md
index d801fc83b..af999d3ab 100644
--- a/c_glib/README.md
+++ b/c_glib/README.md
@@ -158,7 +158,7 @@ based bindings. Here are languages that support GObject 
Introspection:
   * Lua: [LGI](https://github.com/pavouk/lgi) should be used.
     * Examples: `example/lua/` directory.
 
-  * Go: [Go-gir-generator](https://github.com/linuxdeepin/go-gir-generator) 
should be used.
+  * Go: [Go-gir-generator](https://github.com/linuxdeepin/go-gir-generator) 
should be used. (Note that you should use Apache Arrow for Go than Arrow GLib.)
 
 See also
 [Projects/GObjectIntrospection/Users - GNOME 
Wiki!](https://wiki.gnome.org/Projects/GObjectIntrospection/Users)
diff --git a/c_glib/example/go/Makefile b/c_glib/example/go/Makefile
deleted file mode 100644
index fa2163ca8..000000000
--- a/c_glib/example/go/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-# 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.
-
-PROGRAMS =                                     \
-       read-batch                              \
-       read-stream                             \
-       write-batch                             \
-       write-stream
-
-all: build
-
-generate:
-       $$GOPATH/bin/gir-generator              \
-         -o $$GOPATH/src/gir/arrow-1.0         \
-         -config arrow-1.0/config.json         \
-         arrow-1.0/arrow.go.in
-
-build: $(PROGRAMS)
-
-clean:
-       rm -f $(PROGRAMS)
-
-.SUFFIXES: .go
-
-.go:
-       go build -o $@ $<
diff --git a/c_glib/example/go/README.md b/c_glib/example/go/README.md
deleted file mode 100644
index 76eeed78c..000000000
--- a/c_glib/example/go/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-<!---
-  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.
--->
-
-# Arrow Go example
-
-There are Go example codes in this directory.
-
-## How to run
-
-All example codes use
-[go-gir-generator](https://github.com/linuxdeepin/go-gir-generator) to
-use Arrow GLib based bindings.
-
-See [../../README.md](../../README.md) how to install Arrow GLib. You
-can use packages to install Arrow GLib. The following instructions
-assumes that you've installed Arrow GLib by package. Package name is
-`libarrow-glib-dev` on Debian GNU/Linux and Ubuntu, `arrow-glib-devel`
-on CentOS.
-
-Here are command lines to install go-gir-generator on Debian GNU/Linux
-and Ubuntu:
-
-```text
-% sudo apt install -V -y libarrow-glib-dev golang git libgirepository1.0-dev 
libgudev-1.0-dev
-% export GOPATH=$HOME
-% go get github.com/linuxdeepin/go-gir-generator
-% cd $GOPATH/src/github.com/linuxdeepin/go-gir-generator
-% make build copyfile
-% mkdir -p $GOPATH/bin/
-% cp -a out/gir-generator $GOPATH/bin/
-% cp -a out/src/gir/ $GOPATH/src/
-```
-
-Now, you can generate Arrow bindings for Go:
-
-```text
-% git clone https://github.com/apache/arrow.git ~/arrow
-% cd ~/arrow/c_glib/example/go
-% make generate
-```
-
-Then you can build all example codes:
-
-```text
-% cd ~/arrow/c_glib/example/go
-% make
-% ./write-batch  # Write data in batch mode
-% ./read-batch   # Read the written batch mode data
-% ./write-stream # Write data in stream mode
-% ./read-stream  # Read the written stream mode data
-```
-
-## Go example codes
-
-Here are example codes in this directory:
-
-  * `write-batch.go`: It shows how to write Arrow array to file in
-    batch mode.
-
-  * `read-batch.go`: It shows how to read Arrow array from file in
-    batch mode.
-
-  * `write-stream.go`: It shows how to write Arrow array to file in
-    stream mode.
-
-  * `read-stream.go`: It shows how to read Arrow array from file in
-    stream mode.
diff --git a/c_glib/example/go/arrow-1.0/arrow.go.in 
b/c_glib/example/go/arrow-1.0/arrow.go.in
deleted file mode 100644
index 08ee13d25..000000000
--- a/c_glib/example/go/arrow-1.0/arrow.go.in
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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 arrow
-
-/*
-#include "arrow.gen.h"
-#cgo pkg-config: arrow-glib
-
-[<.g_list_funcs>]
-[<.g_error_free>]
-[<.g_free>]
-*/
-import "C"
-import "unsafe"
-
-import (
-       "gir/glib-2.0"
-       "gir/gobject-2.0"
-       "gir/gio-2.0"
-)
-
-[<.go_utils>]
-
-[<.go_bindings>]
diff --git a/c_glib/example/go/arrow-1.0/config.json 
b/c_glib/example/go/arrow-1.0/config.json
deleted file mode 100644
index eea9a898c..000000000
--- a/c_glib/example/go/arrow-1.0/config.json
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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.
-
-{
-    "namespace": "Arrow",
-    "version": "1.0"
-}
diff --git a/c_glib/example/go/read-batch.go b/c_glib/example/go/read-batch.go
deleted file mode 100644
index 1472939cd..000000000
--- a/c_glib/example/go/read-batch.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// 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 main
-
-import (
-       "os"
-       "log"
-       "fmt"
-       "strings"
-)
-
-import "gir/arrow-1.0"
-
-func PrintColumnValue(column *arrow.Array, i int64) {
-       valueType := column.GetValueType()
-       switch valueType {
-       case arrow.TypeUint8:
-               fmt.Print(arrow.ToUInt8Array(column).GetValue(i))
-       case arrow.TypeUint16:
-               fmt.Print(arrow.ToUInt16Array(column).GetValue(i))
-       case arrow.TypeUint32:
-               fmt.Print(arrow.ToUInt32Array(column).GetValue(i))
-       case arrow.TypeUint64:
-               fmt.Print(arrow.ToUInt64Array(column).GetValue(i))
-       case arrow.TypeInt8:
-               fmt.Print(arrow.ToInt8Array(column).GetValue(i))
-       case arrow.TypeInt16:
-               fmt.Print(arrow.ToInt16Array(column).GetValue(i))
-       case arrow.TypeInt32:
-               fmt.Print(arrow.ToInt32Array(column).GetValue(i))
-       case arrow.TypeInt64:
-               fmt.Print(arrow.ToInt64Array(column).GetValue(i))
-       case arrow.TypeFloat:
-               fmt.Print(arrow.ToFloatArray(column).GetValue(i))
-       case arrow.TypeDouble:
-               fmt.Print(arrow.ToDoubleArray(column).GetValue(i))
-       default:
-               fmt.Printf("unknown(%s)", valueType)
-       }
-}
-
-func PrintRecordBatch(recordBatch *arrow.RecordBatch) {
-       nColumns := recordBatch.GetNColumns()
-       for i := uint32(0); i < nColumns; i++ {
-               column := recordBatch.GetColumn(int32(i))
-               columnName := recordBatch.GetColumnName(int32(i))
-               fmt.Printf("  %s: [", columnName)
-               nRows := recordBatch.GetNRows()
-               for j := int64(0); j < nRows; j++ {
-                       if j > 0 {
-                               fmt.Print(", ")
-                       }
-                       PrintColumnValue(column, j)
-               }
-               fmt.Println("]")
-       }
-}
-
-func main() {
-       var path string
-       if len(os.Args) < 2 {
-               path = "/tmp/batch.arrow"
-       } else {
-               path = os.Args[1]
-       }
-       input, err := arrow.NewMemoryMappedInputStream(path);
-       if err != nil {
-               log.Fatalf("Failed to open path: <%s>: %v", path, err)
-       }
-       reader, err := arrow.NewRecordBatchFileReader(input)
-       if err != nil {
-               log.Fatalf("Failed to parse data: %v", err)
-       }
-       var i uint32
-       nRecordBatches := reader.GetNRecordBatches()
-       for i = 0; i < nRecordBatches; i++ {
-               recordBatch, err := reader.ReadRecordBatch(i)
-               if err != nil {
-                       log.Fatalf("Failed to read record batch[%d]: %v", i, 
err)
-               }
-               fmt.Println(strings.Repeat("=", 40))
-               fmt.Printf("record-batch[%d]:\n", i)
-               PrintRecordBatch(recordBatch)
-       }
-}
diff --git a/c_glib/example/go/read-stream.go b/c_glib/example/go/read-stream.go
deleted file mode 100644
index ed75a96c9..000000000
--- a/c_glib/example/go/read-stream.go
+++ /dev/null
@@ -1,101 +0,0 @@
-// 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 main
-
-import (
-       "os"
-       "log"
-       "fmt"
-       "strings"
-)
-
-import "gir/arrow-1.0"
-
-func PrintColumnValue(column *arrow.Array, i int64) {
-       valueType := column.GetValueType()
-       switch valueType {
-       case arrow.TypeUint8:
-               fmt.Print(arrow.ToUInt8Array(column).GetValue(i))
-       case arrow.TypeUint16:
-               fmt.Print(arrow.ToUInt16Array(column).GetValue(i))
-       case arrow.TypeUint32:
-               fmt.Print(arrow.ToUInt32Array(column).GetValue(i))
-       case arrow.TypeUint64:
-               fmt.Print(arrow.ToUInt64Array(column).GetValue(i))
-       case arrow.TypeInt8:
-               fmt.Print(arrow.ToInt8Array(column).GetValue(i))
-       case arrow.TypeInt16:
-               fmt.Print(arrow.ToInt16Array(column).GetValue(i))
-       case arrow.TypeInt32:
-               fmt.Print(arrow.ToInt32Array(column).GetValue(i))
-       case arrow.TypeInt64:
-               fmt.Print(arrow.ToInt64Array(column).GetValue(i))
-       case arrow.TypeFloat:
-               fmt.Print(arrow.ToFloatArray(column).GetValue(i))
-       case arrow.TypeDouble:
-               fmt.Print(arrow.ToDoubleArray(column).GetValue(i))
-       default:
-               fmt.Printf("unknown(%s)", valueType)
-       }
-}
-
-func PrintRecordBatch(recordBatch *arrow.RecordBatch) {
-       nColumns := recordBatch.GetNColumns()
-       for i := uint32(0); i < nColumns; i++ {
-               column := recordBatch.GetColumn(int32(i))
-               columnName := recordBatch.GetColumnName(int32(i))
-               fmt.Printf("  %s: [", columnName)
-               nRows := recordBatch.GetNRows()
-               for j := int64(0); j < nRows; j++ {
-                       if j > 0 {
-                               fmt.Print(", ")
-                       }
-                       PrintColumnValue(column, j)
-               }
-               fmt.Println("]")
-       }
-}
-
-func main() {
-       var path string
-       if len(os.Args) < 2 {
-               path = "/tmp/stream.arrow"
-       } else {
-               path = os.Args[1]
-       }
-       input, err := arrow.NewMemoryMappedInputStream(path);
-       if err != nil {
-               log.Fatalf("Failed to open path: <%s>: %v", path, err)
-       }
-       reader, err := arrow.NewRecordBatchStreamReader(input)
-       if err != nil {
-               log.Fatalf("Failed to parse data: %v", err)
-       }
-       for i := 0; true; i++ {
-               recordBatch, err := reader.ReadNext()
-               if err != nil {
-                       log.Fatalf("Failed to read the next record batch: %v", 
err)
-               }
-               if recordBatch == nil {
-                       break
-               }
-               fmt.Println(strings.Repeat("=", 40))
-               fmt.Printf("record-batch[%d]:\n", i)
-               PrintRecordBatch(recordBatch)
-       }
-}
diff --git a/c_glib/example/go/write-batch.go b/c_glib/example/go/write-batch.go
deleted file mode 100644
index f4d03ed92..000000000
--- a/c_glib/example/go/write-batch.go
+++ /dev/null
@@ -1,214 +0,0 @@
-// 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 main
-
-import (
-       "os"
-       "log"
-)
-
-import "gir/arrow-1.0"
-
-func BuildUInt8Array() *arrow.Array {
-       builder := arrow.NewUInt8ArrayBuilder()
-       for _, value := range []uint8{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt16Array() *arrow.Array {
-       builder := arrow.NewUInt16ArrayBuilder()
-       for _, value := range []uint16{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt32Array() *arrow.Array {
-       builder := arrow.NewUInt32ArrayBuilder()
-       for _, value := range []uint32{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt64Array() *arrow.Array {
-       builder := arrow.NewUInt64ArrayBuilder()
-       for _, value := range []uint64{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt8Array() *arrow.Array {
-       builder := arrow.NewInt8ArrayBuilder()
-       for _, value := range []int8{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt16Array() *arrow.Array {
-       builder := arrow.NewInt16ArrayBuilder()
-       for _, value := range []int16{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt32Array() *arrow.Array {
-       builder := arrow.NewInt32ArrayBuilder()
-       for _, value := range []int32{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt64Array() *arrow.Array {
-       builder := arrow.NewInt64ArrayBuilder()
-       for _, value := range []int64{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildFloatArray() *arrow.Array {
-       builder := arrow.NewFloatArrayBuilder()
-       for _, value := range []float32{1.1, -2.2, 4.4, -8.8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildDoubleArray() *arrow.Array {
-       builder := arrow.NewDoubleArrayBuilder()
-       for _, value := range []float64{1.1, -2.2, 4.4, -8.8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func main() {
-       var output_path string
-       if len(os.Args) < 2 {
-               output_path = "/tmp/batch.arrow"
-       } else {
-               output_path = os.Args[1]
-       }
-
-       fields := []*arrow.Field{
-               arrow.NewField("uint8",  arrow.NewUInt8DataType()),
-               arrow.NewField("uint16", arrow.NewUInt16DataType()),
-               arrow.NewField("uint32", arrow.NewUInt32DataType()),
-               arrow.NewField("uint64", arrow.NewUInt64DataType()),
-               arrow.NewField("int8",   arrow.NewInt8DataType()),
-               arrow.NewField("int16",  arrow.NewInt16DataType()),
-               arrow.NewField("int32",  arrow.NewInt32DataType()),
-               arrow.NewField("int64",  arrow.NewInt64DataType()),
-               arrow.NewField("float",  arrow.NewFloatDataType()),
-               arrow.NewField("double", arrow.NewDoubleDataType()),
-       }
-       schema := arrow.NewSchema(fields)
-
-       output, err := arrow.NewFileOutputStream(output_path, false)
-       if err != nil {
-               log.Fatalf("Failed to open path: <%s>: %v", output_path, err)
-       }
-       writer, err := arrow.NewRecordBatchFileWriter(output, schema)
-       if err != nil {
-               log.Fatalf("Failed to create writer: %v", err)
-       }
-
-       columns := []*arrow.Array{
-               BuildUInt8Array(),
-               BuildUInt16Array(),
-               BuildUInt32Array(),
-               BuildUInt64Array(),
-               BuildInt8Array(),
-               BuildInt16Array(),
-               BuildInt32Array(),
-               BuildInt64Array(),
-               BuildFloatArray(),
-               BuildDoubleArray(),
-       }
-
-       recordBatch, err := arrow.NewRecordBatch(schema, 4, columns)
-       if err != nil {
-               log.Fatalf("Failed to create record batch #1: %v", err)
-       }
-       _, err = writer.WriteRecordBatch(recordBatch)
-       if err != nil {
-               log.Fatalf("Failed to write record batch #1: %v", err)
-       }
-
-       slicedColumns := make([]*arrow.Array, len(columns))
-       for i, column := range columns {
-               slicedColumns[i] = column.Slice(1, 3)
-       }
-       recordBatch, err = arrow.NewRecordBatch(schema, 3, slicedColumns)
-       if err != nil {
-               log.Fatalf("Failed to create record batch #2: %v", err)
-       }
-       _, err = writer.WriteRecordBatch(recordBatch)
-       if err != nil {
-               log.Fatalf("Failed to write record batch #2: %v", err)
-       }
-
-       writer.Close()
-}
diff --git a/c_glib/example/go/write-stream.go 
b/c_glib/example/go/write-stream.go
deleted file mode 100644
index 7225156a7..000000000
--- a/c_glib/example/go/write-stream.go
+++ /dev/null
@@ -1,215 +0,0 @@
-// 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 main
-
-import (
-       "os"
-       "log"
-)
-
-import "gir/arrow-1.0"
-
-func BuildUInt8Array() *arrow.Array {
-       builder := arrow.NewUInt8ArrayBuilder()
-       for _, value := range []uint8{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt16Array() *arrow.Array {
-       builder := arrow.NewUInt16ArrayBuilder()
-       for _, value := range []uint16{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt32Array() *arrow.Array {
-       builder := arrow.NewUInt32ArrayBuilder()
-       for _, value := range []uint32{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildUInt64Array() *arrow.Array {
-       builder := arrow.NewUInt64ArrayBuilder()
-       for _, value := range []uint64{1, 2, 4, 8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt8Array() *arrow.Array {
-       builder := arrow.NewInt8ArrayBuilder()
-       for _, value := range []int8{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt16Array() *arrow.Array {
-       builder := arrow.NewInt16ArrayBuilder()
-       for _, value := range []int16{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt32Array() *arrow.Array {
-       builder := arrow.NewInt32ArrayBuilder()
-       for _, value := range []int32{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildInt64Array() *arrow.Array {
-       builder := arrow.NewInt64ArrayBuilder()
-       for _, value := range []int64{1, -2, 4, -8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildFloatArray() *arrow.Array {
-       builder := arrow.NewFloatArrayBuilder()
-       for _, value := range []float32{1.1, -2.2, 4.4, -8.8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func BuildDoubleArray() *arrow.Array {
-       builder := arrow.NewDoubleArrayBuilder()
-       for _, value := range []float64{1.1, -2.2, 4.4, -8.8} {
-               builder.Append(value)
-       }
-       array, err := builder.Finish()
-               if err != nil {
-               log.Fatalf("Failed to build array: %v", err)
-       }
-       return array
-}
-
-func main() {
-       var output_path string
-       if len(os.Args) < 2 {
-               output_path = "/tmp/stream.arrow"
-       } else {
-               output_path = os.Args[1]
-       }
-
-       fields := []*arrow.Field{
-               arrow.NewField("uint8",  arrow.NewUInt8DataType()),
-               arrow.NewField("uint16", arrow.NewUInt16DataType()),
-               arrow.NewField("uint32", arrow.NewUInt32DataType()),
-               arrow.NewField("uint64", arrow.NewUInt64DataType()),
-               arrow.NewField("int8",   arrow.NewInt8DataType()),
-               arrow.NewField("int16",  arrow.NewInt16DataType()),
-               arrow.NewField("int32",  arrow.NewInt32DataType()),
-               arrow.NewField("int64",  arrow.NewInt64DataType()),
-               arrow.NewField("float",  arrow.NewFloatDataType()),
-               arrow.NewField("double", arrow.NewDoubleDataType()),
-       }
-       schema := arrow.NewSchema(fields)
-
-       output, err := arrow.NewFileOutputStream(output_path, false)
-       if err != nil {
-               log.Fatalf("Failed to open path: <%s>: %v", output_path, err)
-       }
-       writer, err := arrow.NewRecordBatchStreamWriter(output, schema)
-       if err != nil {
-               log.Fatalf("Failed to create writer: %v", err)
-       }
-
-       columns := []*arrow.Array{
-               BuildUInt8Array(),
-               BuildUInt16Array(),
-               BuildUInt32Array(),
-               BuildUInt64Array(),
-               BuildInt8Array(),
-               BuildInt16Array(),
-               BuildInt32Array(),
-               BuildInt64Array(),
-               BuildFloatArray(),
-               BuildDoubleArray(),
-       }
-
-       recordBatch, err := arrow.NewRecordBatch(schema, 4, columns)
-       if err != nil {
-               log.Fatalf("Failed to create record batch #1: %v", err)
-       }
-       _, err = writer.WriteRecordBatch(recordBatch)
-       if err != nil {
-               log.Fatalf("Failed to write record batch #1: %v", err)
-       }
-
-       slicedColumns := make([]*arrow.Array, len(columns))
-       for i, column := range columns {
-               slicedColumns[i] = column.Slice(1, 3)
-       }
-       recordBatch, err = arrow.NewRecordBatch(schema, 3, slicedColumns)
-       if err != nil {
-               log.Fatalf("Failed to create record batch #2: %v", err)
-       }
-       writer.WriteRecordBatch(recordBatch)
-       _, err = writer.WriteRecordBatch(recordBatch)
-       if err != nil {
-               log.Fatalf("Failed to write record batch #2: %v", err)
-       }
-
-       writer.Close()
-}
diff --git a/ci/travis_before_script_c_glib.sh 
b/ci/travis_before_script_c_glib.sh
index 033fbd7c6..e47fe6841 100755
--- a/ci/travis_before_script_c_glib.sh
+++ b/ci/travis_before_script_c_glib.sh
@@ -58,35 +58,6 @@ elif [ $BUILD_SYSTEM = "autotools" ]; then
   fi
 fi
 
-if [ $BUILD_SYSTEM = "autotools" ]; then
-  go get github.com/linuxdeepin/go-gir-generator || :
-  pushd $GOPATH/src/github.com/linuxdeepin/go-gir-generator
-
-  # For old GObject Introspection.
-  # We can remove this when we use more later Ubuntu.
-  mv lib.in/glib-2.0/config.json{,.orig}
-  sed \
-    -e 's/\("unref_to_array"\)/"get_data", \1/g' \
-    lib.in/glib-2.0/config.json.orig > lib.in/glib-2.0/config.json
-
-  # Workaround. TODO: We should send a patch to go-gir-generator.
-  rm lib.in/gio-2.0/gdk_workaround.go
-  mv lib.in/gio-2.0/config.json{,.orig}
-  sed \
-    -e 's/\("Settings",\)/\/\/ \1/g' \
-    -e 's/\("SettingsBackend",\)/\/\/ \1/g' \
-    lib.in/gio-2.0/config.json.orig > lib.in/gio-2.0/config.json
-
-  mv Makefile{,.orig}
-  sed -e 's/ gudev-1.0//' Makefile.orig > Makefile
-  mkdir -p out/src/gir/gudev-1.0
-  make build copyfile
-  mkdir -p $GOPATH/bin/
-  cp -a out/gir-generator $GOPATH/bin/
-  cp -a out/src/gir/ $GOPATH/src/gir/
-  popd
-fi
-
 pushd $ARROW_C_GLIB_DIR
 
 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ARROW_CPP_INSTALL/lib/pkgconfig
diff --git a/ci/travis_script_c_glib.sh b/ci/travis_script_c_glib.sh
index 3833bb170..b0ddccb20 100755
--- a/ci/travis_script_c_glib.sh
+++ b/ci/travis_script_c_glib.sh
@@ -63,13 +63,4 @@ else
 fi
 popd
 
-pushd example/go
-make generate
-make
-./write-batch
-./read-batch
-./write-stream
-./read-stream
-popd
-
 popd


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [GLib] Remove Go example
> ------------------------
>
>                 Key: ARROW-2348
>                 URL: https://issues.apache.org/jira/browse/ARROW-2348
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: GLib
>    Affects Versions: 0.10.0
>            Reporter: Kouhei Sutou
>            Assignee: Kouhei Sutou
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 0.10.0
>
>
> Now, we have Go native implementation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to