embulk / embulk/embulk-output-jdbc

[MySQL] Invalid size for column type bit(0)

Open
#263 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
92
Forks
89
PR merge metrics
No merged PRs in 30d

Description

For the column type `tinyint(1)` , the first execution changes to `boolean`, and the second execution changes to `bit(0)`.

- macOS 10.14.6
- Embulk 0.9.19
- embulk-output-mysql 0.8.6
- MySQL 5.7.21

```
# example table and column

show columns from payment_logs;
...
is_sample: tinyint(1)
...
```

## first time:

```
SQL: CREATE TABLE `payment_logs_0000016db361e8a3_embulk000` (`id` BIGINT, `is_sample` BOOLEAN, `created_at` DATETIME, `updated_at` DATETIME)
```

No errors.

## second time:

```
SQL: CREATE TABLE `payment_logs_0000016db361e8a3_embulk000` (`id` BIGINT, `is_sample` BIT(0), `created_at` DATETIME, `updated_at` DATETIME)
```

```
org.embulk.exec.PartialExecutionException: java.lang.RuntimeException: org.embulk.spi.util.RetryExecutor$RetryGiveupException: java.sql.SQLException: Invalid size for column 'is_sample'.
```

## config:

```
in:
{% if env.ENVIRONMENT == "production" %}
{% include 'commons/input/production' %}
{% else %}
{% include 'commons/input/development' %}
{% endif %}
table: payment_logs
select: "*"

out:
{% if env.ENVIRONMENT == "production" %}
{% include 'commons/output/production' %}
{% else %}
{% include 'commons/output/development' %}
{% endif %}
table: payment_logs
select: "*"
mode: merge
```

I would like to fix it like the example below.

```
out:
...
column_options:
is_sample: { type: TINYINT }
```

Is this a bug?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.