基于URL的外部Web表

基于URL的外部Web表

基于URL的Web表使用HTTP协议从一个Web服务器访问数据。Web表的数据是动态的,该数据不可重复扫描。

使用http://指定一个Web服务器上的文件的LOCATION。Web数据文件必须位于一台Greenplum的Segment主机可访问的服务器上。指定的URL的数量对应于并行工作访问该Web表的Segment实例的数量。例如,如果用户指定两个外部文件给有八个主要Segment的Greenplum数据库系统,在查询运行时这八个Segment中会有两个并行访问该Web表。

下面的示例命令定义一个从数个URL得到数据的Web表。

=# CREATE EXTERNAL WEB TABLE ext_expenses (name text, 
  date date, amount float4, category text, description text) 
  LOCATION ( 

  'http://intranet.company.com/expenses/sales/file.csv',
  'http://intranet.company.com/expenses/exec/file.csv',
  'http://intranet.company.com/expenses/finance/file.csv',
  'http://intranet.company.com/expenses/ops/file.csv',
  'http://intranet.company.com/expenses/marketing/file.csv',
  'http://intranet.company.com/expenses/eng/file.csv' 

   )
  FORMAT 'CSV' ( HEADER );