Giter VIP home page Giter VIP logo

gpdb-kite's Introduction

Kite Foreign Data Wrapper for GPDB7

This GPDB extension implements a Foreign Data Wrapper (FDW) for Kite.

Installation

To compile the Kite foreign data wrapper,

  1. To build on POSIX-compliant systems you need to ensure the pg_config executable is in your path when you run make. This executable is typically in your PostgreSQL installation's bin directory. For example:

    $ export PATH=/usr/local/pgsql/bin/:$PATH
    
  2. Compile the code using make.

    $ make USE_PGXS=1
    
  3. Finally install the foreign data wrapper.

    $ make USE_PGXS=1 install
    

Usage

The following parameters can be set on a Kite foreign server object:

  • host: List of addresses or hostname:port of the Kite servers separated by comma ','.
  • fetch_size: This option specifies the number of rows kite_fdw should get in each fetch operation. It can be specified for a foreign table or a foreign server. The option specified on a table overrides an option specified for the server. The default is 100.

The following parameters can be set on a Kite foreign table object:

  • fragcnt: The number of fragment per query. The default value is -1 (all segments).
  • table_name: Path of Kite table.
  • fetch_size: Same as fetch_size parameter for foreign server.
  • fmt: data format. csv and parquet are supported.
  • csv_delimiter: csv delimiter. Default is ','.
  • csv_quote: csv quote. Default is '"'.
  • csv_escape: csv escape character. Default is '"'.
  • csv_header: csv file with header line. Default is false.
  • csv_nullstr: csv NULL string. Default is empty string.

Examples

SET timezone = 'PST8PDT';
-- optimizer MUST set to off in order to generate partial agg plan
SET optimizer = off;
SET optimizer_trace_fallback = on;
-- If gp_enable_minmax_optimization is on, it won't generate aggregate functions pushdown plan.
SET gp_enable_minmax_optimization = off;

-- load extension first time after install
CREATE EXTENSION kite_fdw;

-- create server object
CREATE SERVER kite_server
	FOREIGN DATA WRAPPER kite_fdw
	OPTIONS (host '127.0.0.1:7878');

-- create user mapping
CREATE USER MAPPING FOR CURRENT_USER SERVER kite_server;

-- create foreign table
CREATE FOREIGN TABLE warehouse
	(
		warehouse_id int,
		warehouse_name text,
		warehouse_created timestamp
	)
	SERVER kite_server
	OPTIONS (table_name 'warehouse*', fmt 'csv', 
	csv_delimiter '|', csv_quote '"', csv_escape '"', csv_header 'false', csv_nullstr '',
	mpp_execute 'all segments');

-- select from table
SELECT * FROM warehouse ORDER BY 1;

warehouse_id | warehouse_name | warehouse_created
-------------+----------------+-------------------
           1 | UPS            | 10-JUL-20 00:00:00
           2 | TV             | 10-JUL-20 00:00:00
           3 | Table          | 10-JUL-20 00:00:00

gpdb-kite's People

Contributors

vderic avatar

Stargazers

Yongtao Huang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.