You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by th...@apache.org on 2014/10/18 03:14:26 UTC

svn commit: r1632715 - in /hive/trunk/ql/src/test: queries/clientpositive/index_in_db.q results/clientpositive/index_in_db.q.out

Author: thejas
Date: Sat Oct 18 01:14:26 2014
New Revision: 1632715

URL: http://svn.apache.org/r1632715
Log:
HIVE-8475 : add test case for use of index from not-current database (Thejas Nair, reviewed by Vaibhav Gumashta)

Added:
    hive/trunk/ql/src/test/queries/clientpositive/index_in_db.q
    hive/trunk/ql/src/test/results/clientpositive/index_in_db.q.out

Added: hive/trunk/ql/src/test/queries/clientpositive/index_in_db.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/index_in_db.q?rev=1632715&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/index_in_db.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/index_in_db.q Sat Oct 18 01:14:26 2014
@@ -0,0 +1,13 @@
+set hive.optimize.index.filter=true; 
+drop database if exists index_test_db cascade;
+-- Test selecting selecting from a table that is backed by an index
+-- create table, index in a db, then set default db as current db, and try selecting
+
+create database index_test_db;
+
+use index_test_db;
+create table testtb (id int, name string);
+create index id_index on table testtb (id) as 'COMPACT' WITH DEFERRED REBUILD  in table testdb_id_idx_tb;
+
+use default;
+select * from index_test_db.testtb where id>2;

Added: hive/trunk/ql/src/test/results/clientpositive/index_in_db.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/index_in_db.q.out?rev=1632715&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/index_in_db.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/index_in_db.q.out Sat Oct 18 01:14:26 2014
@@ -0,0 +1,42 @@
+PREHOOK: query: drop database if exists index_test_db cascade
+PREHOOK: type: DROPDATABASE
+POSTHOOK: query: drop database if exists index_test_db cascade
+POSTHOOK: type: DROPDATABASE
+PREHOOK: query: -- Test selecting selecting from a table that is backed by an index
+-- create table, index in a db, then set default db as current db, and try selecting
+
+create database index_test_db
+PREHOOK: type: CREATEDATABASE
+POSTHOOK: query: -- Test selecting selecting from a table that is backed by an index
+-- create table, index in a db, then set default db as current db, and try selecting
+
+create database index_test_db
+POSTHOOK: type: CREATEDATABASE
+PREHOOK: query: use index_test_db
+PREHOOK: type: SWITCHDATABASE
+POSTHOOK: query: use index_test_db
+POSTHOOK: type: SWITCHDATABASE
+PREHOOK: query: create table testtb (id int, name string)
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:index_test_db
+POSTHOOK: query: create table testtb (id int, name string)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:index_test_db
+POSTHOOK: Output: index_test_db@testtb
+PREHOOK: query: create index id_index on table testtb (id) as 'COMPACT' WITH DEFERRED REBUILD  in table testdb_id_idx_tb
+PREHOOK: type: CREATEINDEX
+POSTHOOK: query: create index id_index on table testtb (id) as 'COMPACT' WITH DEFERRED REBUILD  in table testdb_id_idx_tb
+POSTHOOK: type: CREATEINDEX
+POSTHOOK: Output: index_test_db@testdb_id_idx_tb
+PREHOOK: query: use default
+PREHOOK: type: SWITCHDATABASE
+POSTHOOK: query: use default
+POSTHOOK: type: SWITCHDATABASE
+PREHOOK: query: select * from index_test_db.testtb where id>2
+PREHOOK: type: QUERY
+PREHOOK: Input: index_test_db@testtb
+#### A masked pattern was here ####
+POSTHOOK: query: select * from index_test_db.testtb where id>2
+POSTHOOK: type: QUERY
+POSTHOOK: Input: index_test_db@testtb
+#### A masked pattern was here ####