use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestPrivilegesV2 method setup.
@Before
public void setup() throws Exception {
queryState = new QueryState(null);
//set authorization mode to V2
HiveConf conf = queryState.getConf();
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, SQLStdHiveAuthorizerFactory.class.getName());
db = Mockito.mock(Hive.class);
table = new Table(DB, TABLE);
SessionState.start(conf);
Mockito.when(db.getTable(DB, TABLE, false)).thenReturn(table);
Mockito.when(db.getTable(TABLE_QNAME, false)).thenReturn(table);
Mockito.when(db.getPartition(table, new HashMap<String, String>(), false)).thenReturn(partition);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestMacroSemanticAnalyzer method setup.
@Before
public void setup() throws Exception {
queryState = new QueryState(null);
conf = queryState.getConf();
SessionState.start(conf);
context = new Context(conf);
analyzer = new MacroSemanticAnalyzer(queryState);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestQBCompact method init.
@BeforeClass
public static void init() throws Exception {
queryState = new QueryState(null);
conf = queryState.getConf();
conf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
SessionState.start(conf);
// Create a table so we can work against it
Hive h = Hive.get(conf);
List<String> cols = new ArrayList<String>();
cols.add("a");
List<String> partCols = new ArrayList<String>();
partCols.add("ds");
h.createTable("foo", cols, partCols, OrcInputFormat.class, OrcOutputFormat.class);
Table t = h.getTable("foo");
Map<String, String> partSpec = new HashMap<String, String>();
partSpec.put("ds", "today");
h.createPartition(t, partSpec);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestQBJoinTreeApplyPredicate method initialize.
@BeforeClass
public static void initialize() {
queryState = new QueryState(new HiveConf(SemanticAnalyzer.class));
conf = queryState.getConf();
SessionState.start(conf);
}
use of org.apache.hadoop.hive.ql.QueryState in project hive by apache.
the class TestQBSubQuery method initialize.
@BeforeClass
public static void initialize() {
queryState = new QueryState(new HiveConf(SemanticAnalyzer.class));
conf = queryState.getConf();
SessionState.start(conf);
}
Aggregations