-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql时间字符串(varchar "2018-11-20 10:10:10")支持转为ES的date类型 #305
base: master
Are you sure you want to change the base?
Conversation
@@ -203,7 +203,7 @@ Although there are some other MySQL rivers for Elasticsearch, like [elasticsearc | |||
## Todo | |||
|
|||
+ MySQL 8 | |||
+ ES 6 | |||
+ ES 6 (After verification (version 6.4.2), it is now supported. Delete and update are supported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Em, are you sure we can support ES 6 directly? Seem ES 6 has already removed doc Type?
if col.Type == schema.TYPE_STRING { | ||
col.Type = schema.TYPE_DATETIME | ||
v := r.makeReqColumnData(col, value) | ||
str, _ := v.(string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch v.(type) {
case string:
case []byte:
default:
}
I think you can check string and []byte here.
river/sync.go
Outdated
@@ -514,6 +514,15 @@ func (r *River) getFieldValue(col *schema.TableColumn, fieldType string, value i | |||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: | |||
fieldValue = r.makeReqColumnData(col, time.Unix(v.Int(), 0).Format(mysql.TimeFormat)) | |||
} | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use else if col.Type == schema.TYPE_STRING
No description provided.