Skip to content

Commit

Permalink
Merge pull request #132 from ClickHouse/feat/auto-improve-datetime-in…
Browse files Browse the repository at this point in the history
…ference

feat(proto): improve datetime inference
  • Loading branch information
ernado authored Jun 18, 2022
2 parents 3868814 + 989f06b commit 2f6394a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions proto/col_auto.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func (c *ColAuto) Infer(t ColumnType) error {
default:
switch t.Base() {
case ColumnTypeDateTime:
c.Data = new(ColDateTime)
v := new(ColDateTime)
if err := v.Infer(t); err != nil {
return errors.Wrap(err, "datetime")
}
c.Data = v
c.DataType = t
return nil
case ColumnTypeEnum8, ColumnTypeEnum16:
Expand All @@ -56,7 +60,7 @@ func (c *ColAuto) Infer(t ColumnType) error {
case ColumnTypeDateTime64:
v := new(ColDateTime64)
if err := v.Infer(t); err != nil {
return errors.Wrap(err, "datetime")
return errors.Wrap(err, "datetime64")
}
c.Data = v
c.DataType = t
Expand Down

0 comments on commit 2f6394a

Please sign in to comment.