Skip to content
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

fix mysql-cdc: handle tinyint(1) and boolean correctly + fix target file comparison #3890

Merged
merged 8 commits into from
Jun 7, 2021
Merged
Prev Previous commit
Next Next commit
only deserialize once
  • Loading branch information
subodh1810 committed Jun 4, 2021
commit 9f2c9861207f425cbc6e6c309f5275484ca994d0
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

package io.airbyte.integrations.source.mysql;

import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.collect.AbstractIterator;
import io.airbyte.commons.concurrency.VoidCallable;
import io.airbyte.commons.json.Jsons;
Expand Down Expand Up @@ -115,11 +116,12 @@ private boolean shouldSignalClose(ChangeEvent<String, String> event) {
return false;
}

String file = Jsons.deserialize(event.value()).get("source").get("file").asText();
int position = Jsons.deserialize(event.value()).get("source").get("pos").asInt();
JsonNode valueAsJson = Jsons.deserialize(event.value());
String file = valueAsJson.get("source").get("file").asText();
int position = valueAsJson.get("source").get("pos").asInt();

boolean isSnapshot = SnapshotMetadata.TRUE == SnapshotMetadata.valueOf(
Jsons.deserialize(event.value()).get("source").get("snapshot").asText().toUpperCase());
valueAsJson.get("source").get("snapshot").asText().toUpperCase());

if (isSnapshot || targetFilePosition.get().fileName.compareTo(file) > 0 || targetFilePosition.get().position >= position) {
return false;
Expand Down