Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-17359: [Go][FlightSQL] Create Example with SQLite in-mem and use to test FlightSQL server #13868

Merged
merged 24 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3d7f99f
ARROW-17323: [Go] Cleanup and upgrade dependencies
zeroshade Aug 5, 2022
4d36881
disallow mmap on windows so we can use updated exp pkg.
zeroshade Aug 5, 2022
417037b
initial flightsql client
zeroshade Aug 5, 2022
3384caf
initial implementation
zeroshade Aug 8, 2022
2f2b18a
client unit tests
zeroshade Aug 8, 2022
c83e611
basic test framework for server
zeroshade Aug 8, 2022
88cc0a2
get flight_sql integration up and running
zeroshade Aug 9, 2022
936dfd1
add lots of comments
zeroshade Aug 9, 2022
55a6e4b
so far so good
zeroshade Aug 11, 2022
0a7b350
first batch of tests using sqlite example
zeroshade Aug 12, 2022
76d0864
more updates and handling
zeroshade Aug 12, 2022
24529bc
completed sqlite server example
zeroshade Aug 12, 2022
2dcf2d5
fix tests
zeroshade Aug 14, 2022
84d5d07
nullint16 isn't in go1.16
zeroshade Aug 14, 2022
093b7ef
alleviate race conditions
zeroshade Aug 14, 2022
36bbd17
put sqlite example server behind go1.17+
zeroshade Aug 14, 2022
68df566
updates from feedback
zeroshade Aug 15, 2022
c2a9a6a
fix last nullability for c++ comparison
zeroshade Aug 15, 2022
f32c2f1
fix ruby version test
zeroshade Aug 15, 2022
ef42292
explicitly downgrade zlib to fix js integration?
zeroshade Aug 15, 2022
8ad14df
Merge branch 'master' into arrow-17359-flight-sqlite
zeroshade Aug 15, 2022
db7a6a6
dev version bump tests
zeroshade Aug 15, 2022
2996633
gah put a silly period instead of a comma
zeroshade Aug 15, 2022
72b75b1
remove trailing whitespace
zeroshade Aug 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/docker/conda-integration.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN mamba install -q -y \
nodejs=${node} \
yarn \
openjdk=${jdk} \
zlib=1.2.11 && \
zlib=1.2.11 && \
mamba clean --all --force-pkgs-dirs

# Install Rust with only the needed components
Expand Down
7 changes: 7 additions & 0 deletions dev/release/01-prepare-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ def test_version_pre_tag
],
],
},
{
path: "go/arrow/doc.go",
hunks: [
["-const PkgVersion = \"#{@snapshot_version}\"",
"+const PkgVersion = \"#{@release_version}\""],
],
},
{
path: "go/parquet/writer_properties.go",
hunks: [
Expand Down
15 changes: 13 additions & 2 deletions dev/release/post-11-bump-versions-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@ def test_version_post_tag
]

Dir.glob("go/**/{go.mod,*.go,*.go.*}") do |path|
if path == "go/arrow/doc.go"
expected_changes << {
path: path,
hunks: [
[
"-const PkgVersion = \"#{@snapshot_version}\"",
"+const PkgVersion = \"#{@next_snapshot_version}\"",
],
]}
next
end
import_path = "github.com/apache/arrow/go/v#{@snapshot_major_version}"
lines = File.readlines(path, chomp: true)
target_lines = lines.grep(/#{Regexp.escape(import_path)}/)
Expand All @@ -205,10 +216,10 @@ def test_version_post_tag
hunks << [
"-\tDefaultCreatedBy = \"parquet-go version #{@snapshot_version}\"",
"+\tDefaultCreatedBy = \"parquet-go version #{@next_snapshot_version}\"",
]
]
zeroshade marked this conversation as resolved.
Show resolved Hide resolved
end
expected_changes << {hunks: hunks, path: path}
end
end

Dir.glob("java/**/pom.xml") do |path|
version = "<version>#{@snapshot_version}</version>"
Expand Down
3 changes: 3 additions & 0 deletions dev/release/utils-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ update_versions() {
sed -i.bak -E -e \
"s/\"parquet-go version .+\"/\"parquet-go version ${version}\"/" \
parquet/writer_properties.go
sed -i.bak -E -e \
"s/const PkgVersion = \".*/const PkgVersion = \"${version}\"/" \
arrow/doc.go
find . -name "*.bak" -exec rm {} \;
git add .
popd
Expand Down
2 changes: 2 additions & 0 deletions go/arrow/array/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ func TestListArray(t *testing.T) {
}{
{arrow.LIST, []int32{0, 3, 3, 3, 7}, arrow.ListOf(arrow.PrimitiveTypes.Int32)},
{arrow.LARGE_LIST, []int64{0, 3, 3, 3, 7}, arrow.LargeListOf(arrow.PrimitiveTypes.Int32)},
{arrow.LIST, []int32{0, 3, 3, 3, 7}, arrow.ListOfField(arrow.Field{Name: "item", Type: arrow.PrimitiveTypes.Int32, Nullable: true})},
{arrow.LARGE_LIST, []int64{0, 3, 3, 3, 7}, arrow.LargeListOfField(arrow.Field{Name: "item", Type: arrow.PrimitiveTypes.Int32, Nullable: true})},
}

for _, tt := range tests {
Expand Down
2 changes: 2 additions & 0 deletions go/arrow/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ array is valid (not null). If the array has no null entries, it is possible to o
*/
package arrow

const PkgVersion = "10.0.0-SNAPSHOT"

//go:generate go run _tools/tmpl/main.go -i -data=numeric.tmpldata type_traits_numeric.gen.go.tmpl type_traits_numeric.gen_test.go.tmpl array/numeric.gen.go.tmpl array/numericbuilder.gen.go.tmpl array/bufferbuilder_numeric.gen.go.tmpl
//go:generate go run _tools/tmpl/main.go -i -data=datatype_numeric.gen.go.tmpldata datatype_numeric.gen.go.tmpl tensor/numeric.gen.go.tmpl tensor/numeric.gen_test.go.tmpl
//go:generate go run _tools/tmpl/main.go -i -data=scalar/numeric.gen.go.tmpldata scalar/numeric.gen.go.tmpl scalar/numeric.gen_test.go.tmpl
Expand Down
4 changes: 0 additions & 4 deletions go/arrow/flight/flightsql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ func (c *Client) GetSqlInfo(ctx context.Context, info []SqlInfo, opts ...grpc.Ca
return flightInfoForCommand(ctx, c, cmd, opts...)
}

// Prepare creates a PreparedStatement object for the specified query.
// The resulting PreparedStatement object should be Closed when no longer
// needed. It will maintain a reference to this Client for use to execute
// and use the specified allocator for any allocations it needs to perform.
// Prepare creates a PreparedStatement object for the specified query.
// The resulting PreparedStatement object should be Closed when no longer
// needed. It will maintain a reference to this Client for use to execute
Expand Down
7 changes: 5 additions & 2 deletions go/arrow/flight/flightsql/example/sqlite_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@

package example

import "github.com/apache/arrow/go/v10/arrow/flight/flightsql"
import (
"github.com/apache/arrow/go/v10/arrow"
"github.com/apache/arrow/go/v10/arrow/flight/flightsql"
)

func SqlInfoResultMap() flightsql.SqlInfoResultMap {
return flightsql.SqlInfoResultMap{
uint32(flightsql.SqlInfoFlightSqlServerName): "db_name",
uint32(flightsql.SqlInfoFlightSqlServerVersion): "sqlite 3",
uint32(flightsql.SqlInfoFlightSqlServerArrowVersion): "10.0.0-SNAPSHOT",
uint32(flightsql.SqlInfoFlightSqlServerArrowVersion): arrow.PkgVersion,
uint32(flightsql.SqlInfoFlightSqlServerReadOnly): false,
uint32(flightsql.SqlInfoDDLCatalog): false,
uint32(flightsql.SqlInfoDDLSchema): false,
Expand Down
4 changes: 2 additions & 2 deletions go/arrow/flight/flightsql/schema_ref/reference_schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var (
{Name: "fk_key_name", Type: arrow.BinaryTypes.String, Nullable: true},
{Name: "pk_key_name", Type: arrow.BinaryTypes.String, Nullable: true},
{Name: "update_rule", Type: arrow.PrimitiveTypes.Uint8, Nullable: false},
{Name: "delete_rule", Type: arrow.PrimitiveTypes.Uint8, Nullable: true},
{Name: "delete_rule", Type: arrow.PrimitiveTypes.Uint8, Nullable: false},
}, nil)
ImportedKeys = ImportedExportedKeysAndCrossReference
ExportedKeys = ImportedExportedKeysAndCrossReference
Expand All @@ -88,7 +88,7 @@ var (
{Name: "column_size", Type: arrow.PrimitiveTypes.Int32, Nullable: true},
{Name: "literal_prefix", Type: arrow.BinaryTypes.String, Nullable: true},
{Name: "literal_suffix", Type: arrow.BinaryTypes.String, Nullable: true},
{Name: "create_params", Type: arrow.ListOfField(arrow.Field{Name: "item", Type: arrow.BinaryTypes.String, Nullable: false})},
{Name: "create_params", Type: arrow.ListOfField(arrow.Field{Name: "item", Type: arrow.BinaryTypes.String, Nullable: false}), Nullable: true},
{Name: "nullable", Type: arrow.PrimitiveTypes.Int32, Nullable: false},
{Name: "case_sensitive", Type: arrow.FixedWidthTypes.Boolean, Nullable: false},
{Name: "searchable", Type: arrow.PrimitiveTypes.Int32, Nullable: false},
Expand Down