Skip to content

Commit

Permalink
TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
kshvakov committed Jan 18, 2022
1 parent 383277c commit dece689
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ clickhouse://username:password@host1:9000,host2:9000/database?dial_timeout=200ms

## TODO

* [ ] LowCardinality
* [ ] Bigint types
* [ ] ZSTD
* [ ] Geo
Expand Down
11 changes: 9 additions & 2 deletions tests/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestMap(t *testing.T) {
Col1 Map(String, UInt64)
, Col2 Map(String, UInt64)
, Col3 Map(String, UInt64)
, Col4 Array(Map(String, String))
) Engine Memory
`
if err := conn.Exec(ctx, "DROP TABLE IF EXISTS test_map"); assert.NoError(t, err) {
Expand All @@ -50,18 +51,24 @@ func TestMap(t *testing.T) {
"key_col_2_2": 20,
}
col3Data = map[string]uint64{}
col4Data = []map[string]string{
map[string]string{"A": "B"},
map[string]string{"C": "D"},
}
)
if err := batch.Append(col1Data, col2Data, col3Data); assert.NoError(t, err) {
if err := batch.Append(col1Data, col2Data, col3Data, col4Data); assert.NoError(t, err) {
if assert.NoError(t, batch.Send()) {
var (
col1 map[string]uint64
col2 map[string]uint64
col3 map[string]uint64
col4 []map[string]string
)
if err := conn.QueryRow(ctx, "SELECT * FROM test_map").Scan(&col1, &col2, &col3); assert.NoError(t, err) {
if err := conn.QueryRow(ctx, "SELECT * FROM test_map").Scan(&col1, &col2, &col3, &col4); assert.NoError(t, err) {
assert.Equal(t, col1Data, col1)
assert.Equal(t, col2Data, col2)
assert.Equal(t, col3Data, col3)
assert.Equal(t, col4Data, col4)
}
}
}
Expand Down

0 comments on commit dece689

Please sign in to comment.