This is an automated email from the ASF dual-hosted git repository.
uwe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 9c7e06b ARROW-2348: [GLib] Remove GLib + Go example
9c7e06b is described below
commit 9c7e06b2e520137906f078df185b3a03e674e07d
Author: Kouhei Sutou <[email protected]>
AuthorDate: Sun Mar 25 12:23:09 2018 +0200
ARROW-2348: [GLib] Remove GLib + Go example
We should use Apache Arrow for Go instead.
Author: Kouhei Sutou <[email protected]>
Closes #1785 from kou/glib-remove-go-example and squashes the following
commits:
56a40bd <Kouhei Sutou> Remove GLib + Go example
---
c_glib/README.md | 2 +-
c_glib/example/go/Makefile | 40 ------
c_glib/example/go/README.md | 83 ------------
c_glib/example/go/arrow-1.0/arrow.go.in | 39 ------
c_glib/example/go/arrow-1.0/config.json | 21 ----
c_glib/example/go/read-batch.go | 100 ---------------
c_glib/example/go/read-stream.go | 101 ---------------
c_glib/example/go/write-batch.go | 214 -------------------------------
c_glib/example/go/write-stream.go | 215 --------------------------------
ci/travis_before_script_c_glib.sh | 29 -----
ci/travis_script_c_glib.sh | 9 --
11 files changed, 1 insertion(+), 852 deletions(-)
diff --git a/c_glib/README.md b/c_glib/README.md
index d801fc8..af999d3 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 fa2163c..0000000
--- 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 76eeed7..0000000
--- 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 08ee13d..0000000
--- 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 eea9a89..0000000
--- 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 1472939..0000000
--- 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 ed75a96..0000000
--- 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 f4d03ed..0000000
--- 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 7225156..0000000
--- 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 033fbd7..e47fe68 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 3833bb1..b0ddccb 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
--
To stop receiving notification emails like this one, please contact
[email protected].