Skip to content
Open
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
12 changes: 12 additions & 0 deletions internal/pkg/object/command/clickhouse/column_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ func unwrapCHType(t string) (base string, nullable bool) {
if isDecimal(s) {
return "Decimal", nullable
}
// Normalize type names to handle case variations from driver
// Driver may return "Datetime64" or "DateTime64", etc.
sLower := strings.ToLower(s)

// DateTime64 always has precision: DateTime64(3) or DateTime64(6, 'UTC')
if strings.HasPrefix(sLower, "datetime64(") {
return "DateTime64", nullable
}
// DateTime may have timezone or not: DateTime or DateTime('UTC')
if sLower == "datetime" || strings.HasPrefix(sLower, "datetime(") {
return "DateTime", nullable
}
return s, nullable
}

Expand Down
Loading