简体   繁体   中英

How can I read PostgreSQL Table partitions with AWS Glue Crawler?

My Crawler is not able to read the RDS partitioned table properly when partitions are created in Postgresql 11.

Example of partition DDL is

Table:

CREATE TABLE book (
    ID int8 NULL,
    effectivetodate date NULL,
) PARTITION BY RANGE(effectivetodate);

Partitions:

CREATE TABLE book_historical PARTITION OF portfolio for VALUES FROM ('1000-12-31') TO ('2019-12-31');
CREATE TABLE book_current PARTITION OF portfolio DEFAULT;

The observation is that two tables:

  • book_historical
  • book_current

are created by Crawler but the main table

  • book

is not there.

INstead of using range just pass the column name for partitioning and crawler will dynamically partition based on your column

CREATE TABLE book (
    ID int8 NULL,
    effectivetodate date NULL,
) PARTITION BY effectivetodate;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM