hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yin.zhb@163.com" <yin....@163.com>
Subject Re: Re: no partition for partitioning key make gpload failed.
Date Sun, 15 May 2016 04:10:32 GMT
The point is I set error limits, It should be skip the bad lines,Let the others go.

From: Gagan Brahmi
Date: 2016-05-15 11:19
To: user
CC: dev
Subject: Re: no partition for partitioning key make gpload failed.
Looks like you've a date in ymd column which falls outside the defined range for the two partitions.
You can define a partition which can hold all the data which falls before 20150101 with something
like below:
...partition pre2015 end ('20150101'::date)...

Gagan Brahmi
On May 14, 2016 08:34, "yin.zhb@163.com" <yin.zhb@163.com> wrote:
    I am using hawq 1.1.0,When I using gpload there is a problem:

[gpadmin@stars71 ~]$ psql -d postgres
postgres=# create table stocks
postgres-# (
postgres(# storeno bigint,
postgres(# itemno bigint,
postgres(# itemname text,
postgres(# spec text,
postgres(# itemseq bigint,
postgres(# stocks bigint,
postgres(# unit text,
postgres(# ymd date
postgres(# ) 
postgres-# distributed by (itemno)
postgres-# partition by range(ymd)
postgres-# (
postgres(# partition p2015 start ('20150101'::date) end ('20160101'::date),
postgres(# partition p2016 start ('20160101'::date) end ('20170101'::date)
postgres(# );
NOTICE:  CREATE TABLE will create partition "stocks_1_prt_p2015" for table "stocks"
NOTICE:  CREATE TABLE will create partition "stocks_1_prt_p2016" for table "stocks"
postgres=# \q

[gpadmin@stars71 ctl]$ gpfdist -d /data/data/ -p 8081 -l /home/gpadmin/log &
[gpadmin@stars71 ctl]$ cat stocks.ctl 
DATABASE: postgres
USER: gpadmin
HOST: stars71
PORT: 5432
    - SOURCE:
        - stars71
        PORT: 8081
        - /data/data/*
    - COLUMNS:
        - storeno: bigint
        - itemno: bigint
        - itemname: text
        - spec: text
        - itemseq: bigint
        - stocks: bigint
        - unit: text
        - ymd: date
    - FORMAT: text
    - DELIMITER: E'\t'
    - ERROR_LIMIT: 25
    - ERROR_TABLE: stocks_err
    - TABLE: stocks
[gpadmin@stars71 ctl]$ gpload -f stocks.ctl  
2016-05-14 23:24:19|INFO|gpload session started 2016-05-14 23:24:19
2016-05-14 23:24:19|INFO|setting schema 'public' for table 'stocks'
2016-05-14 23:24:20|INFO|started gpfdist -p 8081 -P 8082 -f "/data/data/*" -t 30
2016-05-14 23:24:20|WARN|A gpload control file processing warning occurred. A delimiter must
have a length of one. Special characters must be quoted. gpload will assume this is a sql
escape character sequence.
2016-05-14 23:24:20|ERROR|ERROR:  no partition for partitioning key  (seg5 localhost:40000
 encountered while running INSERT INTO public."stocks" ("storeno","itemno","itemname","spec","itemseq","stocks","unit","ymd")
SELECT "storeno","itemno","itemname","spec","itemseq","stocks","unit","ymd" FROM ext_gpload20160514_232419_14569
2016-05-14 23:24:20|INFO|rows Inserted                = 0
2016-05-14 23:24:20|INFO|rows Updated               = 0
2016-05-14 23:24:20|INFO|data formatting errors = 0
2016-05-14 23:24:20|INFO|gpload failed

It was failed,even if there is only one line.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message