public void init(QueryState queryState, LogHelper console, Hive db) { this.queryState = queryState; this.conf = queryState.getConf(); this.db = db; this.console = console; }
@Override public HiveConf getConf() { return queryState.getConf(); }
public void init(QueryState queryState, LogHelper console, Hive db) { this.queryState = queryState; this.conf = queryState.getConf(); this.db = db; this.console = console; }
public Driver(QueryState queryState, String userName, QueryInfo queryInfo, HiveTxnManager txnMgr) { this.queryState = queryState; this.conf = queryState.getConf(); this.userName = userName; this.hookRunner = new HookRunner(conf, console); this.queryInfo = queryInfo; this.initTxnMgr = txnMgr; }
public String getExecutionEngine() { return queryState.getConf().getVar(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE); }
public DDLSemanticAnalyzer(QueryState queryState) throws SemanticException { this(queryState, createHiveDB(queryState.getConf())); }
public BaseSemanticAnalyzer(QueryState queryState) throws SemanticException { this(queryState, createHiveDB(queryState.getConf())); }
@VisibleForTesting JSONObject outputPlan(Object work, PrintStream out, boolean extended, boolean jsonOutput, int indent, String appendToHeader) throws Exception { return outputPlan(work, out, extended, jsonOutput, indent, appendToHeader, queryState.getConf().getBoolVar(ConfVars.HIVE_IN_TEST)); }
private void setTxnConfigs() { String validTxnList = queryState.getConf().get(ValidTxnList.VALID_TXNS_KEY); if (validTxnList != null) { conf.set(ValidTxnList.VALID_TXNS_KEY, validTxnList); } }
public void initialize(QueryState queryState, QueryPlan queryPlan, DriverContext driverContext, CompilationOpContext opContext) { this.queryPlan = queryPlan; setInitialized(); this.queryState = queryState; if (null == this.conf) { this.conf = queryState.getConf(); } this.driverContext = driverContext; console = new LogHelper(LOG); } public void setQueryDisplay(QueryDisplay queryDisplay) {
public void initialize(QueryState queryState, QueryPlan queryPlan, DriverContext driverContext, CompilationOpContext opContext) { this.queryPlan = queryPlan; setInitialized(); this.queryState = queryState; this.conf = queryState.getConf(); this.driverContext = driverContext; console = new LogHelper(LOG); } public void setQueryDisplay(QueryDisplay queryDisplay) {
/** * Resets QueryState to get new queryId on Driver reuse. */ public void resetQueryState() { // Note: Driver cleanup for reuse at this point is not very clear. The assumption here is that // repeated compile/execute calls create new contexts, plan, etc., so we don't need to worry // propagating queryState into those existing fields, or resetting them. releaseResources(); this.queryState = new QueryState(queryState.getConf()); } }
@Before public void setUp() { uut = new ExplainTask(); uut.conf = mock(HiveConf.class); out = mock(PrintStream.class); QueryState qs = mock(QueryState.class); HiveConf hiveConf = new HiveConf(); when(qs.getConf()).thenReturn(hiveConf); uut.queryState = qs; }
/** * Invoked before runInternal(). * Set up some preconditions, or configurations. */ protected void beforeRun() { ShimLoader.getHadoopShims().setHadoopQueryContext(queryState.getQueryId()); createOperationLog(); LogUtils.registerLoggingContext(queryState.getConf()); }
@Before public void setup() throws Exception { queryState = new QueryState.Builder().build(); conf = queryState.getConf(); } @Test
@Before public void setup() throws Exception { queryState = new QueryState.Builder().build(); //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); }
@Before public void setup() throws Exception { queryState = new QueryState.Builder().build(); conf = queryState.getConf(); SessionState.start(conf); context = new Context(conf); analyzer = new MacroSemanticAnalyzer(queryState); }
@BeforeClass public static void initialize() { queryState = new QueryState.Builder().withHiveConf(new HiveConf(SemanticAnalyzer.class)).build(); conf = queryState.getConf(); SessionState.start(conf); }
@BeforeClass public static void initialize() { queryState = new QueryState.Builder().withHiveConf(new HiveConf(SemanticAnalyzer.class)).build(); conf = queryState.getConf(); SessionState.start(conf); }
@Before public void setup() { queryState = new QueryState.Builder().build(); conf = queryState.getConf(); conf .setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory"); conf.setVar(HiveConf.ConfVars.DYNAMICPARTITIONINGMODE, "nonstrict"); conf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict"); conf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"); conf.setBoolVar(HiveConf.ConfVars.HIVE_IN_TEST, true); }