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

Remove test coverage for deprecated Object('JSON') type #1377

Merged
merged 3 commits into from
Aug 21, 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
172 changes: 0 additions & 172 deletions examples/clickhouse_api/json.go

This file was deleted.

5 changes: 0 additions & 5 deletions examples/clickhouse_api/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ func TestMain(m *testing.M) {

// ClickHouse API tests

func TestJSON(t *testing.T) {
require.NoError(t, InsertReadJSON())
require.NoError(t, ReadComplexJSON())
}

func TestOpenTelemetry(t *testing.T) {
require.NoError(t, OpenTelemetry())
}
Expand Down
131 changes: 0 additions & 131 deletions examples/std/json.go

This file was deleted.

4 changes: 0 additions & 4 deletions examples/std/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ func TestStdMapInsertRead(t *testing.T) {
require.NoError(t, MapInsertRead())
}

func TestStdJSON(t *testing.T) {
require.NoError(t, JSONInsertRead())
}

func TestStdCompression(t *testing.T) {
require.NoError(t, CompressOpenDB())
require.NoError(t, CompressOpen())
Expand Down
12 changes: 11 additions & 1 deletion lib/column/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ package column

import (
"fmt"
"github.com/ClickHouse/ch-go/proto"
"reflect"
"strings"
"time"

"github.com/ClickHouse/ch-go/proto"
)

// This JSON type implementation was done for an experimental Object('JSON') type:
// https://clickhouse.com/docs/en/sql-reference/data-types/object-data-type
// It's already deprecated in ClickHouse and will be removed in the future.
// Since ClickHouse 24.8, the Object('JSON') type is no longer alias for JSON type.
// The new JSON type has been introduced: https://clickhouse.com/docs/en/sql-reference/data-types/newjson
// However, the new JSON type is not supported by the driver yet.
//
// This implementation is kept for backward compatibility and will be removed in the future. TODO: remove this

// inverse mapping - go types to clickhouse types
var kindMappings = map[reflect.Kind]string{
reflect.String: "String",
Expand Down
3 changes: 2 additions & 1 deletion tests/issues/1072_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

func Test1072(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
t.Skip("Object JSON type is deprecated. Test is kept for a historical reference.")

var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
3 changes: 2 additions & 1 deletion tests/issues/1113_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

func Test1113(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
t.Skip("Object JSON type is deprecated. Test is kept for a historical reference.")

var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
3 changes: 2 additions & 1 deletion tests/issues/1119_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
)

func Test1119(t *testing.T) {
clickhouse_tests.SkipOnCloud(t, "The JSON data type is an obsolete feature on Cloud.")
t.Skip("Object JSON type is deprecated. Test is kept for a historical reference.")

var (
conn, err = clickhouse_tests.GetConnection("issues", clickhouse.Settings{
"max_execution_time": 60,
Expand Down
Loading
Loading