使用存储在s3中的镶木地板文件在Greenplum中创建外部表

问题描述 投票:0回答:1

我正在尝试在Amazon ec2集群上的Greenplum数据库中创建外部表。我的源文件是镶木地板并存储在s3中。我的问题是:

我应该使用什么协议来读取镶木地板文件中的数据?

如果我使用“s3://”文件格式为“Parquet”,如下所示:

CREATE EXTERNAL TABLE rp2 (id text, fname text, lname text, mname text) LOCATION ('s3://location.parquet config=./s3/s3.config')

我收到以下错误:

ERROR:  unexpected end of file  (seg0 slice1 IP:port pid=xxx)

如果我选择gphdfs:// protocol作为:

CREATE EXTERNAL TABLE rp2 (id text, fname text, lname text, mname text) LOCATION ('gphdfs:location.parquet config=./s3/s3.config') FORMAT 'PARQUET';

我收到以下错误:

ERROR:  external table gphdfs protocol command ended with error. Exception in thread "main" java.lang.IllegalArgumentException: Illegal input uri: gphdfs://locs.parquet config=./s3/s3.config  (seg0 slice1 IP:Port pid=pid)

在这方面的任何帮助将受到高度赞赏。

amazon-s3 parquet greenplum external-tables
1个回答
0
投票

您可以使用PXF 在S3上读取镶木地板文件

例:

CREATE EXTERNAL TABLE pxf_ext_tbl(name text, orders int)
  LOCATION ('pxf://S3_BUCKET/dir/file.parquet?PROFILE=s3:parquet&SERVER=s3srvcfg)
 FORMAT 'CUSTOM' (FORMATTER='pxfwritable_import');

© www.soinside.com 2019 - 2024. All rights reserved.