web os commander外部表--有更新版本!


web外部表是只读的的,不像常规的外部表那样可以有写入的,而os commander web外部表的一个变形体,具体看几个例子。
gtlions=# create external web table e_web2 (like emp) execute 'cat ~/gpfdist/emp_exp.txt' format 'text';
CREATE EXTERNAL TABLE
gtlions=# select * from e_web2;      
 empno | ename  |    job    | mgr  |  hiredate  |   sal    |   comm   | deptno
-------+--------+-----------+------+------------+----------+----------+--------
  7499 | ALLEN  | SALESMAN  | 7698 | 1981-02-20 |  1600.00 |   300.00 |     30
  7521 | WARD   | SALESMAN  | 7698 | 1981-02-22 |  1250.00 |   500.00 |     30
  7698 | BLAKE  | MANAGER   | 7839 | 1981-05-01 |  2850.00 |          |     30
  7782 | CLARK  | MANAGER   | 7839 | 1981-06-09 |  2450.00 |          |     10
  7788 | SCOTT  | ANALYST   | 7566 | 1982-12-09 |  3000.00 |          |     20
  7844 | TURNER | SALESMAN  | 7698 | 1981-09-08 |  1500.00 |     0.00 |     30
  。。。
  。。。
gtlions=# create external web table e_web3(txt text) execute 'echo ''this is a rows for e_web3'' ' format 'text';
CREATE EXTERNAL TABLE
gtlions=# select * from e_web3;
            txt            
---------------------------
 this is a rows for e_web3
 this is a rows for e_web3
(2 rows)
gtlions=# create external web table e_web7(txt text) execute 'date' on segment 0 format 'text';             
CREATE EXTERNAL TABLE
gtlions=# select * from e_web7;      
             txt              
------------------------------
 Sat May  4 10:29:41 CST 2013
(1 row)

原来os commander web external可以执行任何os的命令,而且还可以控制是否只在master上执行和在哪个节点上执行,比如最后一个例子e_web7。

-EOF-

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值