Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5D4099E0 for ; Fri, 13 Apr 2012 18:42:46 +0000 (UTC) Received: (qmail 98990 invoked by uid 500); 13 Apr 2012 18:42:46 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 98960 invoked by uid 500); 13 Apr 2012 18:42:46 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 98951 invoked by uid 99); 13 Apr 2012 18:42:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 18:42:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 18:42:44 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 27A8B369936 for ; Fri, 13 Apr 2012 18:42:23 +0000 (UTC) Date: Fri, 13 Apr 2012 18:42:23 +0000 (UTC) From: "Himanshu Vashishtha (Commented) (JIRA)" To: issues@hbase.apache.org Message-ID: <1377110834.23137.1334342543163.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1748804676.25473.1333743202419.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-5741) ImportTsv does not check for table existence MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-5741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253637#comment-13253637 ] Himanshu Vashishtha commented on HBASE-5741: -------------------------------------------- I am waiting for Clint to give me some numbers of such use cases to make the cut; (Apparently, he is on vacation these days and will be back this Monday) Thanks. > ImportTsv does not check for table existence > --------------------------------------------- > > Key: HBASE-5741 > URL: https://issues.apache.org/jira/browse/HBASE-5741 > Project: HBase > Issue Type: Bug > Components: mapreduce > Affects Versions: 0.90.4 > Reporter: Clint Heath > Assignee: Himanshu Vashishtha > Fix For: 0.96.0, 0.94.1 > > Attachments: 5741-94.txt, 5741-v3.txt, HBase-5741-v2.patch, HBase-5741.patch > > > The usage statement for the "importtsv" command to hbase claims this: > "Note: if you do not use this option, then the target table must already exist in HBase" (in reference to the "importtsv.bulk.output" command-line option) > The truth is, the table must exist no matter what, importtsv cannot and will not create it for you. > This is the case because the createSubmittableJob method of ImportTsv does not even attempt to check if the table exists already, much less create it: > (From org.apache.hadoop.hbase.mapreduce.ImportTsv.java) > 305 HTable table = new HTable(conf, tableName); > The HTable method signature in use there assumes the table exists and runs a meta scan on it: > (From org.apache.hadoop.hbase.client.HTable.java) > 142 * Creates an object to access a HBase table. > ... > 151 public HTable(Configuration conf, final String tableName) > What we should do inside of createSubmittableJob is something similar to what the "completebulkloads" command would do: > (Taken from org.apache.hadoop.hbase.mapreduce.LoadIncrementalHFiles.java) > 690 boolean tableExists = this.doesTableExist(tableName); > 691 if (!tableExists) this.createTable(tableName,dirPath); > Currently the docs are misleading, the table in fact must exist prior to running importtsv. We should check if it exists rather than assume it's already there and throw the below exception: > 12/03/14 17:15:42 WARN client.HConnectionManager$HConnectionImplementation: Encountered problems when prefetch META table: > org.apache.hadoop.hbase.TableNotFoundException: Cannot find row in .META. for table: myTable2, row=myTable2,,99999999999999 > at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:150) > ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira