Skip to content

Commit

Permalink
Merge pull request #83 from vijeyash1/main
Browse files Browse the repository at this point in the history
patch for datetime overflow issue
  • Loading branch information
jebinjeb authored Jul 12, 2023
2 parents 4c3a313 + 2b30218 commit 509e162
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 509e162

Please sign in to comment.