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

Removed LowCardinality(UInt64) tests that caused allow_suspicious_low_cardinality_types related error #1206

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions examples/std/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package std

import (
"fmt"

"github.com/ClickHouse/clickhouse-go/v2"
)

Expand All @@ -33,7 +34,7 @@ func MapInsertRead() error {
, Col2 Map(String, UInt64)
, Col3 Map(String, UInt64)
, Col4 Array(Map(String, String))
, Col5 Map(LowCardinality(String), LowCardinality(UInt64))
, Col5 Map(LowCardinality(String), LowCardinality(String))
) Engine Memory
`
conn.Exec("DROP TABLE example")
Expand Down Expand Up @@ -65,9 +66,9 @@ func MapInsertRead() error {
{"A": "B"},
{"C": "D"},
}
col5Data = map[string]uint64{
"key_col_5_1": 100,
"key_col_5_2": 200,
col5Data = map[string]string{
"key_col_5_1": "100",
"key_col_5_2": "200",
}
)
if _, err := batch.Exec(col1Data, col2Data, col3Data, col4Data, col5Data); err != nil {
Expand All @@ -81,7 +82,7 @@ func MapInsertRead() error {
col2 map[string]uint64
col3 map[string]uint64
col4 []map[string]string
col5 map[string]uint64
col5 map[string]string
)
if err := conn.QueryRow("SELECT * FROM example").Scan(&col1, &col2, &col3, &col4, &col5); err != nil {
return err
Expand Down
10 changes: 5 additions & 5 deletions tests/issues/692_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestIssue692(t *testing.T) {
, Col2 Map(String, UInt64)
, Col3 Map(String, UInt64)
, Col4 Array(Map(String, String))
, Col5 Map(LowCardinality(String), LowCardinality(UInt64))
, Col5 Map(LowCardinality(String), LowCardinality(String))
, Col6 Map(String, Map(String, Int64))
) Engine MergeTree() ORDER BY tuple()
`
Expand Down Expand Up @@ -77,9 +77,9 @@ func TestIssue692(t *testing.T) {
{"A": "B"},
{"C": "D"},
}
col5Data = map[string]uint64{
"key_col_5_1": 100,
"key_col_5_2": 200,
col5Data = map[string]string{
"key_col_5_1": "100",
"key_col_5_2": "200",
}
col6Data = map[string]map[string]int64{}
)
Expand All @@ -91,7 +91,7 @@ func TestIssue692(t *testing.T) {
col2 map[string]uint64
col3 map[string]uint64
col4 []map[string]string
col5 map[string]uint64
col5 map[string]string
col6 map[string]map[string]int64
)
require.NoError(t, conn.QueryRow("SELECT Col1, Col2, Col3, Col4, Col5, Col6 FROM test_map").Scan(&col1, &col2, &col3, &col4, &col5, &col6))
Expand Down
10 changes: 5 additions & 5 deletions tests/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestMap(t *testing.T) {
, Col2 Map(String, UInt64)
, Col3 Map(String, UInt64)
, Col4 Array(Map(String, String))
, Col5 Map(LowCardinality(String), LowCardinality(UInt64))
, Col5 Map(LowCardinality(String), LowCardinality(String))
, Col6 Map(String, Map(String,UInt64))
) Engine MergeTree() ORDER BY tuple()
`
Expand All @@ -72,9 +72,9 @@ func TestMap(t *testing.T) {
map[string]string{"A": "B"},
map[string]string{"C": "D"},
}
col5Data = map[string]uint64{
"key_col_5_1": 100,
"key_col_5_2": 200,
col5Data = map[string]string{
"key_col_5_1": "100",
"key_col_5_2": "200",
}
col6Data = map[string]map[string]uint64{
"key_col_6_1": {
Expand All @@ -95,7 +95,7 @@ func TestMap(t *testing.T) {
col2 map[string]uint64
col3 map[string]uint64
col4 []map[string]string
col5 map[string]uint64
col5 map[string]string
col6 map[string]map[string]uint64
)
require.NoError(t, conn.QueryRow(ctx, "SELECT * FROM test_map").Scan(&col1, &col2, &col3, &col4, &col5, &col6))
Expand Down
10 changes: 5 additions & 5 deletions tests/std/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestStdMap(t *testing.T) {
, Col2 Map(String, UInt64)
, Col3 Map(String, UInt64)
, Col4 Array(Map(String, String))
, Col5 Map(LowCardinality(String), LowCardinality(UInt64))
, Col5 Map(LowCardinality(String), LowCardinality(String))
) Engine MergeTree() ORDER BY tuple()
`
defer func() {
Expand All @@ -76,9 +76,9 @@ func TestStdMap(t *testing.T) {
map[string]string{"A": "B"},
map[string]string{"C": "D"},
}
col5Data = map[string]uint64{
"key_col_5_1": 100,
"key_col_5_2": 200,
col5Data = map[string]string{
"key_col_5_1": "100",
"key_col_5_2": "200",
}
)
_, err = batch.Exec(col1Data, col2Data, col3Data, col4Data, col5Data)
Expand All @@ -89,7 +89,7 @@ func TestStdMap(t *testing.T) {
col2 map[string]uint64
col3 map[string]uint64
col4 []map[string]string
col5 map[string]uint64
col5 map[string]string
)
require.NoError(t, conn.QueryRow("SELECT * FROM test_map").Scan(&col1, &col2, &col3, &col4, &col5))
assert.Equal(t, col1Data, col1)
Expand Down
Loading