1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Embulk] .liquid, embulk, in:type=mysql, out:type=file, delimiter=TSVについてのメモ

Last updated at Posted at 2023-01-24

この記事について

EmbulkでTSV出力する時にエラーに遭遇したので解決メモを残します。

実行環境

  • Docker(openjdk:8-jre-alpine)
  • embulk-input-mysql * configの in: 指定
  • Cloud Build (GCP)
  • cloud_sql_proxy

Error

org.embulk.exec.PartialExecutionException: org.embulk.config.ConfigException: java.lang.IllegalArgumentException: Can not deserialize instance of char out of VALUE_STRING token

Code

NG

sample.yml.liquid
out:
  type: file
  file_ext: csv
  formatter:
    type: csv
    charset: UTF-8
    delimiter: '\t'
    quote: '"'
    escape: '\'
    null_string: 'NULL'
    skip_header_lines: 0

delimiter: '\t'の部分です。
delimiter: {{'\t'}}とかdelimiter: '\\t'でもダメ。何故だ。

OK

sample.yml.liquid
out:
  type: file
  file_ext: csv
  formatter:
    type: csv
    charset: UTF-8
    delimiter: '	'
    quote: '"'
    escape: '\'
    null_string: 'NULL'
    skip_header_lines: 0

タブstringを直接入力すればいけました。珍しい。

Btw

formatterにtype: tsvというのはありません。以上です。

補足

2023/1/25

コメント頂いた方より、"で区切る("\t")ことで解消されるケースがあります。
実行環境について追記したのと、この辺りはもう少し追ってみたいと思います。

1
0
7

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?