Skip to content
Merged
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
40 changes: 29 additions & 11 deletions internal/pkg/object/command/clickhouse/column_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var chTypeHandlers = map[string]chScanHandler{
"Decimal": handleDecimal,
"Bool": handleBool,
"Array": handleArray,
"Tuple": handleTuple,
}

// Type handler signature
Expand Down Expand Up @@ -146,19 +147,33 @@ func handleDecimal(nullable bool) (any, func() any) {
return val
}
}
func handleTuple(nullable bool) (any, func() any) {
if nullable {
var p *any
return &p, func() any {
if p == nil || *p == nil {
Comment on lines +150 to +154
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New code in handleTuple uses spaces for indentation and doesn’t match the rest of this Go file’s gofmt/tab formatting. Please run gofmt (or reformat this block) so indentation and brace alignment are consistent.

Copilot uses AI. Check for mistakes.
return nil
}
return *p
}
}
var v any
return &v, func() any { return v }
}


func handleArray(nullable bool) (any, func() any) {
if nullable {
var p *[]any
return &p, func() any {
if p == nil {
return nil
}
return *p
}
}
var v []any
return &v, func() any { return v }
if nullable {
var p *any
return &p, func() any {
if p == nil || *p == nil {
return nil
}
return *p
}
}
var v any
return &v, func() any { return v }
Comment on lines 165 to +176
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleTuple and handleArray now contain identical scan-target logic. Consider factoring this into a shared helper (e.g., reuse makeScanTargetany or introduce a dedicated handler for complex/unknown types) to avoid duplication and keep future fixes in one place.

Copilot uses AI. Check for mistakes.
}

func handleDefault(nullable bool) (any, func() any) {
Expand Down Expand Up @@ -191,6 +206,9 @@ func unwrapCHType(t string) (base string, nullable bool) {
if strings.HasPrefix(s, "Array(") {
return "Array", nullable
}
if strings.HasPrefix(s, "Tuple(") {
return "Tuple", nullable
}
Comment on lines +209 to +211
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added Tuple() branch uses space-indentation and is misaligned vs the surrounding gofmt style. Please gofmt/reformat this block for consistency.

Copilot uses AI. Check for mistakes.

// Decimal(N,S) normalize to "Decimal"
if isDecimal(s) {
Expand Down
Loading