Skip to content

Commit

Permalink
Merge pull request #21 from treasure-data/log_query
Browse files Browse the repository at this point in the history
Enabled log query
  • Loading branch information
sakama authored Jun 2, 2017
2 parents 5c0e5a0 + eb2d649 commit be9afa5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.3.5.1 - 2017-06-02
- Enabled log query for logging on console temporary [#21](https://github.com/treasure-data/embulk-output-mailchimp/pull/21)

## 0.3.4 - 2017-06-01
- Enable JSON type for `address` MERGE field [#20](https://github.com/treasure-data/embulk-output-mailchimp/pull/20)

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ configurations {
provided
}

version = "0.3.4"
version = "0.3.5.1"

sourceCompatibility = 1.7
targetCompatibility = 1.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ private Function<JsonNode, JsonNode> contactMapper(final Map<String, String> all
@Override
public JsonNode apply(JsonNode input)
{
LOG.info(">>>>> Row data <<<<< " + input.toString());

ObjectNode property = JsonNodeFactory.instance.objectNode();
property.put("email_address", input.findPath(task.getEmailColumn()).asText());
property.put("status", task.getDoubleOptIn() ? PENDING.getType() : SUBSCRIBED.getType());
Expand All @@ -272,6 +274,7 @@ public JsonNode apply(JsonNode input)
// Update additional merge fields if exist
if (task.getMergeFields().isPresent() && !task.getMergeFields().get().isEmpty()) {
for (final Column column : schema.getColumns()) {
LOG.info(">>>>> Column name | Column type <<<<<, {} | {}", column.getName(), column.getType().getName());
if (!"".equals(containsCaseInsensitive(column.getName(), task.getMergeFields().get()))) {
if (column.getType().equals(JSON)) {
mergeFields.set(column.getName().toUpperCase(), input.findValue(column.getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void cleanUp()
public ReportResponse push(final ObjectNode node, MailChimpOutputPluginDelegate.PluginTask task)
throws JsonProcessingException
{
LOG.info(">>>>> Payload data <<<<< " + node.toString());
String endpoint = MessageFormat.format(mailchimpEndpoint + "/lists/{0}",
task.getListId());

Expand Down

0 comments on commit be9afa5

Please sign in to comment.