greenplum gpload:配置YML文件错误

时间:2017-02-25 11:34:30

标签: linux greenplum hawq

当我尝试在greenplum中执行gpload时,它会遇到错误。

输入命令:

[gpadmin@mdw ~]$ gpload -f test.yml

我收到错误

2017-02-25 11:19:13|ERROR|configuration file error: expected <block end>, but found '?', line 9

配置YAML文件内容:

VERSION: 1.0.0.1 
DATABASE: gpadmin
USER: gpadmin
HOST: gpdbsne
PORT: 5432
GPLOAD:
   INPUT:
    - SOURCE:
    LOCAL_HOSTNAME:
      - gpdbsne
    PORT: 8999
    FILE:
      - /home/gpadmin/testfile.txt
    - FORMAT: text 
    - DELIMITER: '|'
    - QUOTE: '"'
    - COLUMNS:
       - col1: text
       - col2: text
       - col3: text
       - col4: text
       - col5: text
   OUTPUT:
     - TABLE: public.test
     - MODE: insert 
     - MAPPING:
           col1: col1
           col2: col2

1 个答案:

答案 0 :(得分:1)

我是否正确理解数据结构是:INPUT - SOURCE - LOCAL_HOSTNAME?
如果是这样,请在SOURCE:Item之后添加两个空格 - 根据评论编辑 呈现格式的yml配置高度依赖于制表 因此,工作配置可能如下所示:

VERSION: 1.0.0.1 
DATABASE: gpadmin
USER: gpadmin
HOST: gpdbsne
PORT: 5432
GPLOAD:
  - INPUT:
    - SOURCE:
      LOCAL_HOSTNAME: gpdbsne
      PORT: 8999
      FILE: /home/gpadmin/testfile.txt
    - FORMAT: text 
    - DELIMITER: '|'
    - QUOTE: '"'
    - COLUMNS:
      - col1: text
      - col2: text
      - col3: text
      - col4: text
      - col5: text
  - OUTPUT:
    - TABLE: public.test
    - MODE: insert 
    - MAPPING:
      - col1: col1
      - col2: col2