public TaskAttemptContext(QueryContext queryContext, final ExecutionBlockContext executionBlockContext, final TaskAttemptId taskId, final FragmentProto[] fragments, final Path workDir) { this.queryContext = queryContext; if (executionBlockContext != null) { // For unit tests this.workerContext = executionBlockContext.getWorkerContext(); this.sharedResource = executionBlockContext.getSharedResource(); } this.taskId = taskId; if (fragments != null) { for (FragmentProto t : fragments) { if (fragmentMap.containsKey(t.getId())) { fragmentMap.get(t.getId()).add(t); } else { List<FragmentProto> frags = new ArrayList<>(); frags.add(t); fragmentMap.put(t.getId(), frags); } } } this.workDir = workDir; this.shuffleFileOutputs = Maps.newHashMap(); this.state = TaskAttemptState.TA_PENDING; this.partitionOutputVolume = Maps.newHashMap(); this.partitions = new ArrayList<>(); // set to system timezone for forwarded query this.evalContext.setTimeZone(queryContext.getConf().getSystemTimezone()); }
public TaskAttemptContext(QueryContext queryContext, final ExecutionBlockContext executionBlockContext, final TaskAttemptId taskId, final FragmentProto[] fragments, final Path workDir) { this.queryContext = queryContext; if (executionBlockContext != null) { // For unit tests this.workerContext = executionBlockContext.getWorkerContext(); this.sharedResource = executionBlockContext.getSharedResource(); } this.taskId = taskId; if (fragments != null) { for (FragmentProto t : fragments) { if (fragmentMap.containsKey(t.getId())) { fragmentMap.get(t.getId()).add(t); } else { List<FragmentProto> frags = new ArrayList<FragmentProto>(); frags.add(t); fragmentMap.put(t.getId(), frags); } } } this.workDir = workDir; this.shuffleFileOutputs = Maps.newHashMap(); this.state = TaskAttemptState.TA_PENDING; this.partitionOutputVolume = Maps.newHashMap(); this.partitions = TUtil.newList(); // set to system timezone for forwarded query this.evalContext.setTimeZone(queryContext.getConf().getSystemTimezone()); }
@Override public EvalNode visitUnaryEval(LogicalPlanner.PlanContext context, UnaryEval unaryEval, Stack<EvalNode> stack) { stack.push(unaryEval); EvalNode child = visit(context, unaryEval.getChild(), stack); stack.pop(); unaryEval.setChild(child); if (child.getType() == EvalType.CONST) { // session's time zone String timezoneId = context.getQueryContext().get(SessionVars.TIMEZONE); EvalContext evalContext = new EvalContext(); evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId)); unaryEval.bind(evalContext, null); return new ConstEval(unaryEval.eval(null)); } return unaryEval; }
@Override public EvalNode visitUnaryEval(LogicalPlanner.PlanContext context, UnaryEval unaryEval, Stack<EvalNode> stack) { stack.push(unaryEval); EvalNode child = visit(context, unaryEval.getChild(), stack); stack.pop(); unaryEval.setChild(child); if (child.getType() == EvalType.CONST) { // session's time zone String timezoneId = context.getQueryContext().get(SessionVars.TIMEZONE); EvalContext evalContext = new EvalContext(); evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId)); unaryEval.bind(evalContext, null); return new ConstEval(unaryEval.eval(null)); } return unaryEval; }
evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId));
evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId));
evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId));
evalContext.setTimeZone(TimeZone.getTimeZone(timezoneId));
evalContext.setTimeZone(timeZone);