Return-Path: X-Original-To: apmail-tajo-dev-archive@minotaur.apache.org Delivered-To: apmail-tajo-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C733F1094B for ; Fri, 4 Oct 2013 08:11:04 +0000 (UTC) Received: (qmail 43131 invoked by uid 500); 4 Oct 2013 08:10:55 -0000 Delivered-To: apmail-tajo-dev-archive@tajo.apache.org Received: (qmail 43107 invoked by uid 500); 4 Oct 2013 08:10:54 -0000 Mailing-List: contact dev-help@tajo.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tajo.incubator.apache.org Delivered-To: mailing list dev@tajo.incubator.apache.org Received: (qmail 43096 invoked by uid 99); 4 Oct 2013 08:10:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Oct 2013 08:10:51 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 04 Oct 2013 08:10:47 +0000 Received: (qmail 35463 invoked by uid 99); 4 Oct 2013 08:07:41 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Oct 2013 08:07:41 +0000 Date: Fri, 4 Oct 2013 08:07:41 +0000 (UTC) From: "Hyunsik Choi (JIRA)" To: dev@tajo.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (TAJO-220) Implement catalog dump feature MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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:06 AM: ------------------------------------------------------------ I've uploaded the patch. After this patch, users can backup the tajo catalog to a sql dump 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 restore the catalog from this sql dump 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)