首頁 資料庫 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脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++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文件時出現警告提示“此工作簿包含指向一個或多個可能不安全的外部來源的連結”,您可以嘗試以下解決方案來解決該問題:檢查工作簿中的外部連結並刪除不受信任的鏈接。使用編輯連結功能

如何在真我手機上建立資料夾? 如何在真我手機上建立資料夾? Mar 23, 2024 pm 02:30 PM

標題:真我手機新手指南:如何在真我手機上建立資料夾?在現今社會,手機已成為人們生活中不可或缺的工具。而真我手機作為一款備受歡迎的智慧型手機品牌,其簡潔、實用的作業系統備受用戶喜愛。在使用真實我手機的過程中,很多人可能會遇到需要整理手機中的檔案和應用程式的情況,而建立資料夾就是一種有效的方式。本文將介紹如何在真我手機上建立資料夾,幫助使用者更好地管理自己的手機內容。第

如何在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.最後在頁面下方會彈出一個「儲存成功」的提示,代表家庭已經成功創建好了。

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

如何使用Highcharts建立甘特圖表,需要具體程式碼範例引言:甘特圖是一種常用於展示專案進度和時間管理的圖表形式,能夠直觀地展示任務的開始時間、結束時間和進度。 Highcharts是一款功能強大的JavaScript圖表庫,提供了豐富的圖表類型和靈活的配置選項。本文將介紹如何使用Highcharts建立甘特圖表,並給出具體的程式碼範例。一、Highchart

Oracle DECODE函數詳解及用法範例 Oracle DECODE函數詳解及用法範例 Mar 08, 2024 pm 03:51 PM

Oracle中的DECODE函數是一種條件式,常用於在查詢語句中根據不同的條件傳回不同的結果。本文將詳細介紹DECODE函數的語法、用法和範例程式碼。一、DECODE函數語法DECODE(expr,search1,result1[,search2,result2,...,default])expr:要進行比較的表達式或欄位。 search1,

Go語言的縮排規範及範例 Go語言的縮排規範及範例 Mar 22, 2024 pm 09:33 PM

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

Python函數介紹:isinstance函數的用法和範例 Python函數介紹:isinstance函數的用法和範例 Nov 04, 2023 pm 03:15 PM

Python函數介紹:isinstance函數的用法和範例Python是一門功能強大的程式語言,提供了許多內建函數,使得程式設計變得更加方便和有效率。其中一個非常有用的內建函數是isinstance()函數。本文將介紹isinstance函數的用法和範例,並提供具體的程式碼範例。 isinstance()函數用來判斷一個物件是否是指定的類別或類型的實例。該函數的語法如下

See all articles