Skip to content

Instantly share code, notes, and snippets.

@xunzhang
Created September 16, 2016 09:46
Show Gist options
  • Save xunzhang/b07124c43dfe74a905255a43467932e4 to your computer and use it in GitHub Desktop.
Save xunzhang/b07124c43dfe74a905255a43467932e4 to your computer and use it in GitHub Desktop.
wuhong@pivotal-2:~$ source ~/Desktop/local/greenplum_path.sh
wuhong@pivotal-2:~$ ipython
In [1]: from pygresql import pg
In [2]: from gppylib.db import dbconn
In [3]: url = dbconn.DbURL(dbname='postgres')
In [4]: conn = pg.connect(dbname=url.pgdb, host=url.pghost, port=url.pgport, user=url.pguser, passwd=url.pgpass, opt='-c gp_session_role=utility')
In [5]: qry = 'create table xx(i int4) with (appendonly=true, orientation=Parquet, compresstype=None, compresslevel=0, pagesize=1048576, rowgroupsize=8388608, bucketnum=6) DISTRIBUTED RANDOMLY;'
In [6]: conn.query(qry)
In [7]: conn.query(qry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment