ablog

不器用で落着きのない技術者のメモ

2022-08-21から1日間の記事一覧

Redshiftでクエリの中間結果が書き出された箇所を調べる

AWS

Redshift で TEMP TABLE を作成して、中間結果をディスクに書き出す。 dev=# CREATE TEMP TABLE TEST1 DISTSTYLE EVEN SORTKEY(lo_orderkey) AS SELECT * FROM lineorder; 実行中のクエリのクエリIDを調べる dev=# select trim(u.usename) as user, s.pid, q…

Redshift で列長に合わせて文字列を切詰める

AWS

You can't use SUBSTRING to predictably extract the prefix of a string that might contain multi-byte characters because you need to specify the length of a multi-byte string based on the number of bytes, not the number of characters. To ext…