Skip to content

Commit

Permalink
chore: remove duplication of code
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Jun 19, 2022
1 parent f193225 commit 79852cb
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,46 +802,6 @@ func TestClient_Query(t *testing.T) {
require.Equal(t, data.Row(i), gotData.Row(i))
}
})
t.Run("InsertGeoPoint", func(t *testing.T) {
t.Parallel()
conn := ConnOpt(t, Options{
Settings: []Setting{
// https://clickhouse.com/docs/en/sql-reference/data-types/geo/
SettingInt("allow_experimental_geo_types", 1),
},
})
require.NoError(t, conn.Do(ctx, Query{
Body: "CREATE TABLE test_table (v Point) ENGINE = Memory",
}), "create table")

data := new(proto.ColPoint)
data.AppendArr([]proto.Point{
{X: 1, Y: 0},
{X: 0, Y: 1},
{X: 1, Y: 1},
{X: 0, Y: 0},
{X: 0, Y: -1},
})
require.NoError(t, conn.Do(ctx, Query{
Body: "INSERT INTO test_table VALUES",
Input: []proto.InputColumn{
{Name: "v", Data: data},
},
}), "insert")

gotData := new(proto.ColPoint)
require.NoError(t, conn.Do(ctx, Query{
Body: "SELECT * FROM test_table",
Result: proto.Results{
{Name: "v", Data: gotData},
},
}), "select")

require.Equal(t, data.Rows(), gotData.Rows())
for i := 0; i < data.Rows(); i++ {
require.Equal(t, data.Row(i), gotData.Row(i))
}
})
t.Run("SelectInterval", func(t *testing.T) {
t.Parallel()
conn := Conn(t)
Expand Down

0 comments on commit 79852cb

Please sign in to comment.