Skip to content

Commit

Permalink
patch for datetime overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vijeyash1 committed Jul 12, 2023
1 parent 2764414 commit 2a0b8e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/pkg/clickhouse/db_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (c *DBClient) InsertKubvizEvent(metrics model.Metrics) {
if _, err := stmt.Exec(
metrics.ClusterName,
string(metrics.Event.UID),
time.Now(),
time.Now().Format("2006-01-02 15:04:05"),
metrics.Type,
metrics.Event.Name,
metrics.Event.Namespace,
Expand All @@ -219,8 +219,8 @@ func (c *DBClient) InsertKubvizEvent(metrics model.Metrics) {
metrics.Event.Reason,
metrics.Event.Source.Host,
string(eventJson),
metrics.Event.FirstTimestamp.Time,
metrics.Event.LastTimestamp.Time,
metrics.Event.FirstTimestamp.Time.Format("2006-01-02 15:04:05"),
metrics.Event.LastTimestamp.Time.Format("2006-01-02 15:04:05"),
); err != nil {
log.Fatal(err)
}
Expand Down
6 changes: 3 additions & 3 deletions client/pkg/clickhouse/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const kubvizTable DBStatement = `
CREATE TABLE IF NOT EXISTS events (
ClusterName String,
Id String,
EventTime DateTime64,
EventTime String,
OpType String,
Name String,
Namespace String,
Expand All @@ -15,8 +15,8 @@ const kubvizTable DBStatement = `
Reason String,
Host String,
Event String,
FirstTime DateTime64,
LastTime DateTime64
FirstTime String,
LastTime String
) engine=File(TabSeparated)
`
const rakeesTable DBStatement = `
Expand Down

0 comments on commit 2a0b8e1

Please sign in to comment.