Skip to content

support TYPE_DATETIME to es date (RFC3339 UTC) #143

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

Merged
merged 6 commits into from
Oct 2, 2017

Conversation

henter
Copy link
Contributor

@henter henter commented Sep 29, 2017

No description provided.

@siddontang
Copy link
Collaborator

Thanks @henter

Does This PR has the same purpose with #135?

Please add test.

river/sync.go Outdated
case schema.TYPE_DATETIME:
switch v := value.(type) {
case string:
vt, _ := time.Parse("2006-01-02 15:04:05", string(v))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem you can use mysql.TimeFormat directly.

river/sync.go Outdated
switch v := value.(type) {
case string:
vt, _ := time.Parse("2006-01-02 15:04:05", string(v))
timezone := time.Now().Local().Format("-0700")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why -0700 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks :-)

@siddontang
Copy link
Collaborator

hi @henter

Can you add a test for this PR?

@henter
Copy link
Contributor Author

henter commented Sep 30, 2017

return nil, errors.Trace(err)
}

var m map[string]map[string]map[string]map[string]map[string]interface{}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

horrible type here, seem it is better to define a structure here.

@henter
Copy link
Contributor Author

henter commented Oct 1, 2017

@siddontang mapping struct updated. thanks.

Copy link
Collaborator

@siddontang siddontang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@siddontang siddontang merged commit e14f509 into go-mysql-org:master Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants