HAWQ is an in-memory, distributed SQL query engine that runs as a Hadoop service. It provides two-way integration with HDFS, Hive, and HBase. HAWQ supports SQL transactions through commands like BEGIN, COMMIT, and ROLLBACK. External tables in HAWQ can be used to query data stored in HDFS files, Hive tables, and HBase tables.
6. Transaction
[gpadmin@edge ~]$ gpsql
psql (8.2.15)
Type "help" for help.
template1=# create table transaction_test(col1 varchar(50));
CREATE TABLE
template1=# begin transaction;
BEGIN
template1=# insert into transaction_test values('123');
INSERT 0 1
template1=# commit;
COMMIT
template1=# select * from transaction_test;
col1
------
123
(1 row)
template1=# begin transaction;
BEGIN
template1=# insert into transaction_test values('456');
INSERT 0 1
template1=# rollback;
ROLLBACK
template1=# select * from transaction_test;
col1
------
123
(1 row)
7. Transaction
template1=# begin transaction;
BEGIN
template1=# delete from transaction_test;
ERROR: Delete append-only table statement not supported yet
template1=# select * from transaction_test;
ERROR: current transaction is aborted, commands ignored until end of transaction block
template1=# end
template1-# ;
ROLLBACK
template1=#
template1=# begin transaction;
BEGIN
template1=# update transaction_test set col1 = '456';
ERROR: Update append-only table statement not supported yet
template1=# end;
ROLLBACK
template1=#