You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tajo.apache.org by "Hyunsik Choi (JIRA)" <ji...@apache.org> on 2013/10/04 10:01:54 UTC

[jira] [Comment Edited] (TAJO-220) Implement catalog dump feature

    [ https://issues.apache.org/jira/browse/TAJO-220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13785982#comment-13785982 ] 

Hyunsik Choi edited comment on TAJO-220 at 10/4/13 8:01 AM:
------------------------------------------------------------

I've uploaded the patch. After this patch, users can backup the tajo catalog to a sql file as follows:

{code}
$ bin/tajo_dump customer > table_backup.sql
$ cat table_backup.sql
-- Tajo database dump
-- Dump date: 10/04/2013 16:28:03
--

--
-- Name: customer; Type: TABLE; Storage: CSV
-- Path: file:/home/hyunsik/tpch/customer
--
CREATE EXTERNAL TABLE customer (c_custkey INT8, c_name TEXT, c_address TEXT, c_nationkey INT8, c_phone TEXT, c_acctbal FLOAT8, c_mktsegment TEXT, c_comment TEXT) USING CSV LOCATION 'file:/home/hyunsik/tpch/customer';
{code}

You can also backup the catalog from this sql as follows:
{code}
$ bin/tsql -f table_backup.sql
{code}

If you use an option '-a', tajo_dump will dump all table DDLs.
{code}
$ bin/tajo_dump -a > all_backup.sql
{code}


was (Author: hyunsik):
I've uploaded the patch. After this patch, users can backup the tajo catalog to a sql file as follows:

{code}
$ bin/tajo_dump customer > table_backup.sql
$ cat table_backup.sql
-- Tajo database dump
-- Dump date: 10/04/2013 16:28:03
--

--
-- Name: customer; Type: TABLE; Storage: CSV
-- Path: file:/home/hyunsik/tpch/customer
--
CREATE EXTERNAL TABLE customer (c_custkey INT8, c_name TEXT, c_address TEXT, c_nationkey INT8, c_phone TEXT, c_acctbal FLOAT8, c_mktsegment TEXT, c_comment TEXT) USING CSV LOCATION 'file:/home/hyunsik/tpch/customer';
{code}

You can also backup the catalog from this sql as follows:
{code}
bin/tsql -f table_backup.sql
{code}

If you use an option '-a', tajo_dump will dump all table DDLs.
{code}
bin/tajo_dump -a > all_backup.sql
{code}

> Implement catalog dump feature
> ------------------------------
>
>                 Key: TAJO-220
>                 URL: https://issues.apache.org/jira/browse/TAJO-220
>             Project: Tajo
>          Issue Type: New Feature
>          Components: catalog
>            Reporter: Hyunsik Choi
>            Priority: Critical
>              Labels: backup, restore
>             Fix For: 0.2-incubating
>
>         Attachments: TAJO-220.patch
>
>
> The current catalog does not support backup and restore feature. Catalog dump feature will print out all tables and others included in catalog as Tajo DDL statements (i.e., SQL) via stdout. It can also be stored as a file via shell redirection.
> Also, we need a script to call catalog dump feature in a convenient way as follows:
> {code}
> $ bin/tajo_dump [table name or db name] > tajo_backup.sql
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)