-
Notifications
You must be signed in to change notification settings - Fork 74
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] last_record with timestamp column stored wrong timestamp. #126
Comments
Hello, @ganchiku Thank you for your comment, It seems to work well in my environment. diff --git a/embulk-input-mysql/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java b/embulk-input-mysql/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java
index f128ee1..9033c8f 100644
--- a/embulk-input-mysql/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java
+++ b/embulk-input-mysql/src/main/java/org/embulk/input/mysql/getter/MySQLTimestampTimestampIncrementalHandler.java
@@ -22,8 +22,8 @@ public class MySQLTimestampTimestampIncrementalHandler
@Override
public org.embulk.spi.time.Timestamp utcTimestampFromSessionTime(long epochSecond, int nano)
{
- long sec = sessionTimeZone.convertLocalToUTC(epochSecond * 1000, false) / 1000;
- return org.embulk.spi.time.Timestamp.ofEpochSecond(sec, nano);
+// long sec = sessionTimeZone.convertLocalToUTC(epochSecond * 1000, false) / 1000;
+ return org.embulk.spi.time.Timestamp.ofEpochSecond(epochSecond, nano);
}
@Override After applying above change, The I want to verify one thing.
Because when I execute the following SQL, It returns the wrong result.
|
Thank you for your investigation, and I'm sorry that I have deleted my previous comment on this issue. I am still skeptical that my configuration might be bad. But it was follows:
I will look into this issue more. Thank you. |
@ganchiku @hiroyuki-sato As you wrote, we shoudn't convert timestamp in If you make PR, I'll merge. |
Those data is
JST
timezone.Execute
embulk run -o diff.yml input_mysql.yml.liquid
The
last_record
should be2017-12-01T15:00:00.000000Z
but It set2017-12-01T06:00:00.000000Z
And second execution log
Reference
The text was updated successfully, but these errors were encountered: