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 3 years have passed since last update.

Glueデータカタログのテーブルにデータ型decimalを指定する際の注意点(Athena)

Posted at

概要

AthenaやRedshift SpectrumからS3ファイルに対してクエリする際にテーブル定義をGlueデータカタログに登録するかと思いますが、その際のカラムのデータ型にdecimalを指定する際の注意点についてです。

事象

カラムのデータ型の指定でdecimal(10, 5)のようにprecisionとscaleの間に空白を入れると、Athenaからのクエリでは以下のようなエラーが出ます。

HIVE_METASTORE_ERROR: com.facebook.presto.spi.PrestoException: Error: name expected at the position 11 of 'decimal(10, 5)' but ' ' is found.

ちなみにRedshift Spectrumからのクエリではエラーは出ません。

解決策

上記のエラー文からもわかるように空白がエラー原因となっているため、空白を無くしdecimal(10,5)のようにすれば問題ありません。
Prestoの仕様なんでしょうね。。

1
0
0

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?