[ https://issues.apache.org/jira/browse/HIVE-25989?focusedWorklogId=738601&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-738601 ]
ASF GitHub Bot logged work on HIVE-25989: ----------------------------------------- Author: ASF GitHub Bot Created on: 09/Mar/22 08:17 Start Date: 09/Mar/22 08:17 Worklog Time Spent: 10m Work Description: pvary commented on a change in pull request #3076: URL: https://github.com/apache/hive/pull/3076#discussion_r822387571 ########## File path: hbase-handler/src/test/org/apache/hadoop/hive/hbase/TestHBaseQueries.java ########## @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.hadoop.hive.hbase; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.MiniHBaseCluster; +import org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.DriverFactory; +import org.apache.hadoop.hive.ql.IDriver; +import org.apache.hadoop.hive.ql.processors.CommandProcessorException; +import org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.metastore.utils.TestTxnDbUtil; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.Test; + +public class TestHBaseQueries { + + private static MiniZooKeeperCluster zooKeeperCluster; + private static MiniHBaseCluster miniHBaseCluster; + private final HiveConf baseConf; + private IDriver driver; + + /** + * Test class for running queries using HBase tables. Creates a mini ZK and an HBase test cluster. + * Each test method must instantiate a driver object first, using either the baseConf or a modified version of that. + * Once finished, each test method must take care of cleaning up any database objects they've created (tables, Review comment: Is there an easy way to do this in the before/after methods? Not super important, as we do not have multiple tests ATM, just asking -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 738601) Time Spent: 50m (was: 40m) > CTLT HBaseStorageHandler is dropping underlying HBase table when failed > ----------------------------------------------------------------------- > > Key: HIVE-25989 > URL: https://issues.apache.org/jira/browse/HIVE-25989 > Project: Hive > Issue Type: Bug > Reporter: Naresh P R > Assignee: Marton Bod > Priority: Major > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > > With hive.strict.managed.tables & hive.create.as.acid, > Hive-Hbase rollback code is assuming it is a createTable failure instead of > CTLT & removing underlying hbase table while rolling back at here. > [https://github.com/apache/hive/blob/master/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseMetaHook.java#L187-L195] > > Repro > > {code:java} > hbase > ===== > hbase shell > create 'hbase_hive_table', 'cf' > beeline > ======= > set hive.support.concurrency=true; > set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; > set hive.strict.managed.tables=true; > set hive.create.as.acid=true; > set hive.create.as.insert.only=true; > set hive.default.fileformat.managed=ORC; > > CREATE EXTERNAL TABLE `hbase_hive_table`( > `key` int COMMENT '', > `value` string COMMENT '') > ROW FORMAT SERDE > 'org.apache.hadoop.hive.hbase.HBaseSerDe' > STORED BY > 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' > WITH SERDEPROPERTIES ( > 'hbase.columns.mapping'=':key,cf:cf') > TBLPROPERTIES ('hbase.table.name'='hbase_hive_table'); > > select * from hbase_hive_table; > +-----------------------+-------------------------+ > | hbase_hive_table.key | hbase_hive_table.value | > +-----------------------+-------------------------+ > +-----------------------+-------------------------+ > > create table new_hbase_hive_table like hbase_hive_table; > Caused by: org.apache.hadoop.hive.metastore.api.MetaException: The table must > be stored using an ACID compliant format (such as ORC): > default.new_hbase_hive_table > > select * from hbase_hive_table; > Error: java.io.IOException: org.apache.hadoop.hbase.TableNotFoundException: > hbase_hive_table > {code} -- This message was sent by Atlassian Jira (v8.20.1#820001)