首页 数据库 mysql教程 GreenPlum创建外部表示例

GreenPlum创建外部表示例

Jun 07, 2016 pm 03:22 PM
example greenplum 创建 外部 示例

Example 1—Single Greenplum file server (gpfdist) instance on multiple NIC machine Creates a readable external table named ext_expenses using the gpfdist protocol. The files are formatted with a pipe ( | ) as the column delimiter. CREATE E

Example 1—Single Greenplum file server (gpfdist) instance on multiple NIC machine Creates a readable external table named ext_expenses using the gpfdist protocol. The files are formatted with a pipe ( | ) as the column delimiter.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gpfdist://etlhost-1:8081/*', 'gpfdist://etlhost-2:8081/*' ) FORMAT 'TEXT' (DELIMITER '|');

Example 2—Multiple Greenplum file server (gpfdist) instances Creates a readable external table named ext_expenses using the gpfdist protocol from all files with the txt extension. The files are formatted with a pipe ( | ) as the column delimiter and an empty space as null.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gpfdist://etlhost-1:8081/*.txt', 'gpfdist://etlhost-2:8082/*.txt' ) FORMAT 'TEXT' ( DELIMITER '|' NULL ' ') ;

Example 3—Multiple secure Greenplum file server (gpfdists) instances Creates a readable external table named ext_expenses using the gpfdists protocol from all files with the txt extension. The files are formatted with a pipe ( | ) as the column delimiter and an empty space as null.
First, run gpfdist with the --ssl option. Then, execute the following command.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gpfdists://etlhost-1:8081/*.txt', 'gpfdists://etlhost-2:8082/*.txt' ) FORMAT 'TEXT' ( DELIMITER '|' NULL ' ') ;

Example 4—Single Greenplum file server (gpfdist) instance with error logging Creates a readable external table named ext_expenses using the gpfdist protocol from all files with the txt extension. The files are formatted with a pipe ( | ) as the column delimiter and an empty space as null.
The external table is accessed in single row error isolation mode. An error table (err_customer) is specified. Any data formatting errors that are found in the input data will be discarded to err_customer, along with a description of the error. err_customer can later be queried in order to see the nature of errors and reload the rejected data after fixing the issues. If the count of badly formatted data rows on any specific segment is greater than five (specified as the SEGMENT REJECT LIMIT value), the entire external table operation will be aborted and no rows will be processed.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gpfdist://etlhost-1:8081/*.txt', 'gpfdist://etlhost-2:8082/*.txt' ) FORMAT 'TEXT' ( DELIMITER '|' NULL ' ') LOG ERRORS INTO err_customer SEGMENT REJECT LIMIT 5;
Create the same readable external table definition as above, but with CSV formatted files:
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gpfdist://etlhost-1:8081/*.txt', 'gpfdist://etlhost-2:8082/*.txt' ) FORMAT 'CSV' ( DELIMITER ',' ) LOG ERRORS INTO err_customer SEGMENT REJECT LIMIT 5;

Example 5—TEXT Format on a Hadoop Distributed File Server (HDFS) Creates a readable external table named ext_expenses using the gphdfs protocol. The files are formatted with a pipe ( | ) as the column delimiter.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'gphdfs://hdfshost-1:8081/data/filename.txt' ) FORMAT 'TEXT' (DELIMITER '|');
Note: Only one data path is permitted with gphdfs. For examples of reading and writing custom formatted data on a Hadoop Distributed File System.

Example 6—Multiple file protocols in CSV format with header rows Creates a readable external table named ext_expenses using the file protocol.The wildcard specifications are not the same for all the files. The files are formatted in CSV format and have a header row.
CREATE EXTERNAL TABLE ext_expenses ( name text, date date, amount float4, category text, desc1 text ) LOCATION ( 'file://filehost:5432/data/international/*', 'file://filehost:5432/data/regional/*' 'file://filehost:5432/data/supplement/*.csv' ) FORMAT 'CSV' (HEADER);

Example 7—Readable Web External Table with Script Create a readable web external table that executes a script once per segment host:
CREATE EXTERNAL WEB TABLE log_output (linenum int, message text) EXECUTE '/var/load_scripts/get_log_data.sh' ON HOST FORMAT 'TEXT' (DELIMITER '|');

Example 8—Writable External Table that Writes to a File Create a writable external table named sales_out that uses gpfdist to write output data to a file named sales.out. The files are formatted with a pipe (|) as the column delimiter and an empty space as null.
CREATE WRITABLE EXTERNAL TABLE sales_out (LIKE sales) LOCATION ('gpfdist://etl1:8081/sales.out') FORMAT 'TEXT' ( DELIMITER '|' NULL ' ') DISTRIBUTED BY (txn_id);

Example 9—Writable External Web Table with Script Create a writable external web table that pipes output data received by the segments to an executable script named to_adreport_etl.sh:
CREATE WRITABLE EXTERNAL WEB TABLE campaign_out (LIKE campaign) EXECUTE '/var/unload_scripts/to_adreport_etl.sh' FORMAT 'TEXT' (DELIMITER '|');
Use the writable external table defined above to unload selected data:
INSERT INTO campaign_out SELECT * FROM campaign WHERE customer_id=123;

Example 10—Readable and Writable External Tables with XML Transformations Greenplum Database now can read and write XML data to and from external tables with gpfdist. For information on setting up an XML transform, see “Transforming XML Data” on page 178. The following code reads XML data into a table.
CREATE READABLE EXTERNAL TABLE prices_readable (LIKE prices) LOCATION ('gpfdist://127.0.0.1:8080/data/prices.xml#transform=prices_input') FORMAT 'text' (delimiter '|') LOG ERRORS INTO prices_errortable SEGMENT REJECT LIMIT 10;
The following code creates a writable external table that transforms the data in the Greenplum Database to XML.
CREATE WRITABLE EXTERNAL TABLE prices_readable (LIKE prices) LOCATION ('gpfdist://127.0.0.1:8080/data/prices.xml#transform=prices_input') FORMAT 'text' (delimiter '|');
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

此工作簿包含指向一个或多个可能不安全的外部源的链接 此工作簿包含指向一个或多个可能不安全的外部源的链接 Feb 26, 2024 am 11:07 AM

Excel是否继续抛出此工作簿包含指向一个或多个外部源的链接,这些外部源在打开工作簿时可能会显示不安全警告消息?许多用户报告说,无论何时打开Excel文件都会收到此警告。虽然该警告指示工作簿中存在潜在的恶意链接,但即使您已包含受信任的外部来源,也可能会触发该警告此工作簿包含指向一个或多个可能不安全的外部源的链接如果打开Excel文件时出现警告提示“此工作簿包含指向一个或多个可能不安全的外部源的链接”,您可以尝试以下解决方案来解决该问题:检查工作簿中的外部链接并删除不受信任的链接。使用编辑链接功能

如何在GIMP中创建像素艺术 如何在GIMP中创建像素艺术 Feb 19, 2024 pm 03:24 PM

本文将引起您的兴趣,如果您有意在Windows上使用GIMP进行像素艺术创作。GIMP是一款著名的图形编辑软件,不仅免费开源,还能帮助用户轻松创建出美丽的图像和设计。除了适用于初学者和专业设计师外,GIMP也可以用于制作像素艺术,这种数字艺术形式是利用像素作为唯一构建块来进行绘制和创作的。如何在GIMP中创建像素艺术以下是在WindowsPC上使用GIMP创建像素图片的主要步骤:下载并安装GIMP,然后启动应用程序。创建一个新的形象。调整宽度和高度的大小。选择铅笔工具。将笔刷类型设置为像素。设置

格力+如何创建家庭 格力+如何创建家庭 Mar 01, 2024 pm 12:40 PM

很多朋友表示想知道在格力+软件里该怎么去创建家庭,下面为大家带来了操作方法,想要了解的朋友和我一起来看看吧。首先,打开手机上的格力+软件,并登录。接着,在页面底部的选项栏中,点击最右边的“我的”选项,即可进入个人账户页面。2.来到我的页面后,在“家庭”下方的选项里有一个“创建家庭”,找到后在它的上面点击进入。3.接下来跳转到创建家庭的页面里,根据提示在输入框里输入要设置的家庭名称,输入好后在右上角点击“保存”按钮。4.最后在页面下方会弹出一个“保存成功”的提示,代表家庭已经成功创建好了。

Go语言的缩进规范及示例 Go语言的缩进规范及示例 Mar 22, 2024 pm 09:33 PM

Go语言的缩进规范及示例Go语言是一种由Google开发的编程语言,它以简洁、清晰的语法着称,其中缩进规范在代码的可读性和美观性方面起着至关重要的作用。本文将介绍Go语言的缩进规范,并通过具体的代码示例进行详细说明。缩进规范在Go语言中,缩进使用制表符(tab)而非空格。每级缩进为一个制表符,通常设置为4个空格的宽度。这样的规范统一了代码风格,使得团队合作编

如何使用Highcharts创建甘特图表 如何使用Highcharts创建甘特图表 Dec 17, 2023 pm 07:23 PM

如何使用Highcharts创建甘特图表,需要具体代码示例引言:甘特图是一种常用于展示项目进度和时间管理的图表形式,能够直观地展示任务的开始时间、结束时间和进度。Highcharts是一款功能强大的JavaScript图表库,提供了丰富的图表类型和灵活的配置选项。本文将介绍如何使用Highcharts创建甘特图表,并给出具体的代码示例。一、Highchart

Python函数介绍:eval函数的功能和示例 Python函数介绍:eval函数的功能和示例 Nov 04, 2023 pm 12:24 PM

Python函数介绍:eval函数的功能和示例在Python编程中,eval函数是非常有用的一个函数。eval函数可以将一个字符串作为程序代码进行执行,它的功能非常强大。在本文中,我们将介绍eval函数的详细功能,以及一些使用示例。一、eval函数的功能eval函数的功能非常简单,它可以将一个字符串作为Python代码进行执行。这意味着,我们可以将一个字符串

如何创建您的 iPhone 联系人海报 如何创建您的 iPhone 联系人海报 Mar 02, 2024 am 11:30 AM

在iOS17中,Apple为其常用的“电话”和“通讯录”应用程序新增了联系人海报功能。这一功能允许用户为每个联系人设置个性化的海报,使通讯录更具可视化和个性化。联系人海报可以帮助用户更快速地识别和定位特定联系人,提高了用户体验。通过这一功能,用户可以根据自己的喜好和需求,为每个联系人添加特定的图片或标识,使通讯录界面更加生动iOS17中的Apple为iPhone用户提供了一种新颖的方式来表达自己,并添加了可个性化的联系海报。联系人海报功能允许您在呼叫其他iPhone用户时展示独特的个性化内容。您

Oracle DECODE函数详解及用法示例 Oracle DECODE函数详解及用法示例 Mar 08, 2024 pm 03:51 PM

Oracle中的DECODE函数是一种条件表达式,常用于在查询语句中根据不同的条件返回不同的结果。本文将详细介绍DECODE函数的语法、用法和示例代码。一、DECODE函数语法DECODE(expr,search1,result1[,search2,result2,...,default])expr:要进行比较的表达式或字段。search1,

See all articles