• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

gpdb: Greenplum 之前是一家总部位于美国加利福尼亚州,为全球大型企业用户提供新型企 ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

gpdb

开源软件地址:

https://gitee.com/mirrors/gpdb

开源软件介绍:

Concourse Pipeline Concourse Build Status |Travis Build Travis Build Status |Zuul Regression Test On Arm Zuul Regression Test Status


Greenplum

Greenplum Database (GPDB) is an advanced, fully featured, opensource data warehouse, based on PostgreSQL. It provides powerful and rapid analytics onpetabyte scale data volumes. Uniquely geared toward big dataanalytics, Greenplum Database is powered by the world’s most advancedcost-based query optimizer delivering high analytical queryperformance on large data volumes.

The Greenplum project is released under the Apache 2license. We want to thankall our past and present community contributors and are really interested inall new potential contributions. For the Greenplum Database communityno contribution is too small, we encourage all types of contributions.

Overview

A Greenplum cluster consists of a coordinator server, and multiplesegment servers. All user data resides in the segments, the coordinatorcontains only metadata. The coordinator server, and all the segments, sharethe same schema.

Users always connect to the coordinator server, which divides up the queryinto fragments that are executed in the segments, and collects the results.

More information can be found on the project website.

Building Greenplum Database with GPORCA

GPORCA is a cost-based optimizer which is used by Greenplum Database inconjunction with the PostgreSQL planner. It is also known as just ORCA, andPivotal Optimizer. The code for GPORCA resides src/backend/gporca. It is builtautomatically by default.

Installing dependencies (for macOS developers)

Follow these macOS steps for getting your system ready for GPDB

Installing dependencies (for Linux developers)

Follow appropriate linux steps for getting your system ready for GPDB

Build the database

# Configure build environment to install at /usr/local/gpdb./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=/usr/local/gpdb# Compile and installmake -j8make -j8 install# Bring in greenplum environment into your running shellsource /usr/local/gpdb/greenplum_path.sh# Start demo clustermake create-demo-cluster# (gpdemo-env.sh contains __PGPORT__ and __MASTER_DATA_DIRECTORY__ values)source gpAux/gpdemo/gpdemo-env.sh

The directory and the TCP ports for the demo cluster can be changed on the fly.Instead of make cluster, consider:

DATADIRS=/tmp/gpdb-cluster PORT_BASE=5555 make cluster

The TCP port for the regression test can be changed on the fly:

PGPORT=5555 make installcheck-world

To turn GPORCA off and use Postgres planner for query optimization:

set optimizer=off;

If you want to clean all generated files

make distclean

Running tests

  • The default regression tests
make installcheck-world
  • The top-level target installcheck-world will run all regressiontests in GPDB against the running cluster. For testing individualparts, the respective targets can be run separately.

  • The PostgreSQL check target does not work. Setting up aGreenplum cluster is more complicated than a single-node PostgreSQLinstallation, and no-one's done the work to have make checkcreate a cluster. Create a cluster manually or use gpAux/gpdemo/(example below) and run the toplevel make installcheck-worldagainst that. Patches are welcome!

  • The PostgreSQL installcheck target does not work either, becausesome tests are known to fail with Greenplum. Theinstallcheck-good schedule in src/test/regress excludes thosetests.

  • When adding a new test, please add it to one of the GPDB-specific tests,in greenplum_schedule, rather than the PostgreSQL tests inherited from theupstream. We try to keep the upstream tests identical to the upstreamversions, to make merging with newer PostgreSQL releases easier.

Alternative Configurations

Building GPDB without GPORCA

Currently, GPDB is built with GPORCA by default. If you want to build GPDBwithout GPORCA, configure requires --disable-orca flag to be set.

# Clean environmentmake distclean# Configure build environment to install at /usr/local/gpdb./configure --disable-orca --with-perl --with-python --with-libxml --prefix=/usr/local/gpdb

Building GPDB with PXF

PXF is an extension framework for GPDB to enable fast access to external hadoop datasets.Refer to PXF extension for more information.

Currently, GPDB is built with PXF by default (--enable-pxf is on).In order to build GPDB without pxf, simply invoke ./configure with additional option --disable-pxf.PXF requires curl, so --enable-pxf is not compatible with the --without-libcurl option.

Building GPDB with Python3 enabled

GPDB supports Python3 with plpython3u UDF

See how to enable Python3 for details.

Building GPDB client tools on Windows

See Building GPDB client tools on Windows for details.

Development with Vagrant

There is a Vagrant-based quickstart guide for developers.

Code layout

The directory layout of the repository follows the same general layoutas upstream PostgreSQL. There are changes compared to PostgreSQLthroughout the codebase, but a few larger additions worth noting:

  • gpMgmt/

    Contains Greenplum-specific command-line tools for managing thecluster. Scripts like gpinit, gpstart, gpstop live here. They aremostly written in Python.

  • gpAux/

    Contains Greenplum-specific release management scripts, and vendoreddependencies. Some additional directories are submodules and will bemade available over time.

  • gpcontrib/

    Much like the PostgreSQL contrib/ directory, this directory containsextensions such as gpfdist, PXF and gpmapreduce which are Greenplum-specific.

  • doc/

    In PostgreSQL, the user manual lives here. In Greenplum, the usermanual is maintained separately and only the reference pages usedto build man pages are here.

  • gpdb-doc/

    Contains the Greenplum documentation in DITA XML format. Refer togpdb-doc/README.md for information on how to build, and work withthe documentation.

  • ci/

    Contains configuration files for the GPDB continuous integration system.

  • src/backend/cdb/

    Contains larger Greenplum-specific backend modules. For example,communication between segments, turning plans into parallelizableplans, mirroring, distributed transaction and snapshot management,etc. cdb stands for Cluster Database - it was a workname used inthe early days. That name is no longer used, but the cdb prefixremains.

  • src/backend/gpopt/

    Contains the so-called translator library, for using the GPORCAoptimizer with Greenplum. The translator library is written in C++code, and contains glue code for translating plans and queriesbetween the DXL format used by GPORCA, and the PostgreSQL internalrepresentation.

  • src/backend/gporca/

    Contains the GPORCA optimizer code and tests. This is written in C++. SeeREADME.md for more information and how tounit-test GPORCA.

  • src/backend/fts/

    FTS is a process that runs in the coordinator node, and periodicallypolls the segments to maintain the status of each segment.

Contributing

Greenplum is maintained by a core team of developers with commit rights to themain gpdb repository on GitHub. At thesame time, we are very eager to receive contributions from anybody in the widerGreenplum community. This section covers all you need to know if you want to seeyour code or documentation changes be added to Greenplum and appear in thefuture releases.

Getting started

Greenplum is developed on GitHub, and anybody wishing to contribute to it willhave to have a GitHub account and be familiarwith Git tools and workflow.It is also recommend that you follow the developer's mailing listsince some of the contributions may generate more detailed discussions there.

Once you have your GitHub account, forkthis repository so that you can have your private copy to start hacking on and touse as source of pull requests.

Anybody contributing to Greenplum has to be covered by either the Corporate orthe Individual Contributor License Agreement. If you have not previously doneso, please fill out and submit the Contributor License Agreement.Note that we do allow for really trivial changes to be contributed without aCLA if they fall under the rubric of obvious fixes.However, since our GitHub workflow checks for CLA by default you may find iteasier to submit one instead of claiming an "obvious fix" exception.

Licensing of Greenplum contributions

If the contribution you're submitting is original work, you can assume that Pivotalwill release it as part of an overall Greenplum release available to the downstreamconsumers under the Apache License, Version 2.0. However, in addition to that, Pivotalmay also decide to release it under a different license (such as PostgreSQL License to the upstream consumers that require it. A typical example here would be Pivotalupstreaming your contribution back to PostgreSQL community (which can be done eitherverbatim or your contribution being upstreamed as part of the larger changeset).

If the contribution you're submitting is NOT original work you have to indicate the nameof the license and also make sure that it is similar in terms to the Apache License 2.0.Apache Software Foundation maintains a list of these licenses under Category A. In addition to that, you may be required to make proper attribution in theNOTICE file similar to these examples.

Finally, keep in mind that it is NEVER a good idea to remove licensing headers fromthe work that is not your original one. Even if you are using parts of the file thatoriginally had a licensing header at the top you should err on the side of preserving it.As always, if you are not quite sure about the licensing implications of your contributions,feel free to reach out to us on the developer mailing list.

Coding guidelines

Your chances of getting feedback and seeing your code merged into the projectgreatly depend on how granular your changes are. If you happen to have a biggerchange in mind, we highly recommend engaging on the developer's mailing listfirst and sharing your proposal with us before you spend a lot of time writingcode. Even when your proposal gets validated by the community, we still recommenddoing the actual work as a series of small, self-contained commits. This makesthe reviewer's job much easier and increases the timeliness of feedback.

When it comes to C and C++ parts of Greenplum, we try to followPostgreSQL Coding Conventions.In addition to that we require that:

  • All Python code passes Pylint
  • All Go code is formatted according to gofmt

We recommend using git diff --color when reviewing your changes so that youdon't have any spurious whitespace issues in the code that you submit.

All new functionality that is contributed to Greenplum should be covered by regressiontests that are contributed alongside it. If you are uncertain on how to test or documentyour work, please raise the question on the gpdb-dev mailing list and the developercommunity will do its best to help you.

At the very minimum you should always be runningmake installcheck-worldto make sure that you're not breaking anything.

Changes applicable to upstream PostgreSQL

If the change you're working on touches functionality that is common between PostgreSQLand Greenplum, you may be asked to forward-port it to PostgreSQL. This is not only sothat we keep reducing the delta between the two projects, but also so that any changethat is relevant to PostgreSQL can benefit from a much broader review of the upstreamPostgreSQL community. In general, it is a good idea to keep both code bases handy soyou can be sure whether your changes may need to be forward-ported.

Submission timing

To improve the odds of the right discussion of your patch or idea happening, pay attentionto what the community work cycle is. For example, if you send in a brand new idea in thebeta phase of a release, we may defer review or target its inclusion for a later version.Feel free to ask on the mailing list to learn more about the Greenplum release policy and timing.

Patch submission

Once you are ready to share your work with the Greenplum core team and the rest ofthe Greenplum community, you should push all the commits to a branch in your ownrepository forked from the official Greenplum andsend us a pull request.

We welcome submissions which are work in-progress in order to get feedback earlyin the development process. When opening the pull request, select "Draft" inthe dropdown menu when creating the PR to clearly mark the intent of the pullrequest. Prefixing the title with "WIP:" is also good practice.

All new features should be submitted against the main master branch. Bugfixesshould too be submitted against master unless they only exist in a supportedback-branch. If the bug exists in both master and back-branches, explain thisin the PR description.

Validation checks and CI

Once you submit your pull request, you will immediately see a number of validationchecks performed by our automated CI pipelines. There also will be a CLA checktelling you whether your CLA was recognized. If any of these checks fails, youwill need to update your pull request to take care of the issue. Pull requestswith failed validation checks are very unlikely to receive any further peerreview from the community members.

Keep in mind that the most common reason for a failed CLA check is a mismatchbetween an email on file and an email recorded in the commits submitted aspart of the pull request.

If you cannot figure out why a certain validation check failed, feel free toask on the developer's mailing list, but make sure to include a direct linkto a pull request in your email.

Patch review

A submitted pull request with passing validation checks is assumed to be availablefor peer review. Peer review is the process that ensures that contributions to Greenplumare of high quality and align well with the road map and community expectations. Everymember of the Greenplum community is encouraged to review pull requests and providefeedback. Since you don't have to be a core team member to be able to do that, werecommend following a stream of pull reviews to anybody who's interested in becominga long-term contributor to Greenplum. As Linus would say"given enough eyeballs, all bugs are shallow".

One outcome of the peer review could be a consensus that you need to modify yourpull request in certain ways. GitHub allows you to push additional commits intoa branch from which a pull request was sent. Those additional commits will be thenvisible to all of the reviewers.

A peer review converges when it receives at least one +1 and no -1s votes fromthe participants. At that point you should expect one of the core teammembers to pull your changes into the project.

Greenplum prides itself on being a collaborative, consensus-driven environment.We do not believe in vetoes and any -1 vote casted as part of the peer reviewhas to have a detailed technical explanation of what's wrong with the change.Should a strong disagreement arise it may be advisable to take the matter ontothe mailing list since it allows for a more natural flow of the conversation.

At any time during the patch review, you may experience delays based on theavailability of reviewers and core team members. Please be patient. That beingsaid, don't get discouraged either. If you're not getting expected feedback fora few days add a comment asking for updates on the pull request itself or sendan email to the mailing list.

Direct commits to the repository

On occasion you will see core team members committing directly to the repositorywithout going through the pull request workflow. This is reserved for small changesonly and the rule of thumb we use is this: if the change touches any functionalitythat may result in a test failure, then it has to go through a pull request workflow.If, on the other hand, the change is in the non-functional part of the code base(such as fixing a typo inside of a comment block) core team members can decide tojust commit to the repository directly.

Documentation

For Greenplum Database documentation, please check theonline documentation.

For further information beyond the scope of this README, please seeour wiki


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap