Skip to content

Commit

Permalink
bulker: clickhouse: change date format for String columns to ISO
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Nov 19, 2024
1 parent 483cf06 commit e9f47a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bulkerlib/implementations/sql/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/jitsucom/bulker/jitsubase/errorj"
"github.com/jitsucom/bulker/jitsubase/jsoniter"
"github.com/jitsucom/bulker/jitsubase/logging"
"github.com/jitsucom/bulker/jitsubase/timestamp"
types2 "github.com/jitsucom/bulker/jitsubase/types"
"github.com/jitsucom/bulker/jitsubase/utils"
"github.com/jitsucom/bulker/jitsubase/uuid"
Expand Down Expand Up @@ -949,7 +950,7 @@ func convertType(value any, column types.SQLColumn) (any, error) {
case "string":
switch n := v.(type) {
case time.Time:
return n.Format("2006-01-02 15:04:05Z"), nil
return n.Format(timestamp.JsonISO), nil
case int64:
return strconv.FormatInt(n, 10), nil
case float64:
Expand Down
2 changes: 1 addition & 1 deletion bulkerlib/implementations/sql/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var (

MaxColumnsCount = bulker.ImplementationOption[int]{
Key: "maxColumnsCount",
DefaultValue: 10000,
DefaultValue: 5000,
ParseFunc: utils.ParseInt,
}

Expand Down
2 changes: 1 addition & 1 deletion bulkerlib/types/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func anyToBoolean(v any) (any, error) {
func timestampToString(v any) (any, error) {
switch t := v.(type) {
case time.Time:
return t.Format(timestamp.Layout), nil
return t.Format(timestamp.JsonISO), nil
case string:
return t, nil
default:
Expand Down

0 comments on commit e9f47a4

Please sign in to comment.