@Override public DateTimeZone deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException { String tzId = jp.getText(); return DateTimes.inferTzfromString(tzId); } }
public static DateTimeZone toTimeZone(final Expr timeZoneArg) { if (!timeZoneArg.isLiteral()) { throw new IAE("Time zone must be a literal"); } final Object literalValue = timeZoneArg.getLiteralValue(); return literalValue == null ? DateTimeZone.UTC : DateTimes.inferTzfromString((String) literalValue); }
timeZone = DateTimes.inferTzfromString(String.valueOf(tzParam)); } else { timeZone = plannerConfig.getSqlTimeZone();
timeZone = DateTimes.inferTzfromString((String) args.get(2).getLiteralValue()); } else { timeZone = DateTimeZone.UTC;
final DateTimeZone timeZone = operands.size() > 3 && !RexLiteral.isNullLiteral(operands.get(3)) ? DateTimes.inferTzfromString(RexLiteral.stringValue(operands.get(3))) : plannerContext.getTimeZone(); final PeriodGranularity granularity = new PeriodGranularity(period, origin, timeZone);
: "yyyy-MM-dd'T'HH:mm:ss.SSSZZ"; final DateTimeZone timeZone = call.getOperands().size() > 2 && !RexLiteral.isNullLiteral(call.getOperands().get(2)) ? DateTimes.inferTzfromString(RexLiteral.stringValue(call.getOperands().get(2))) : plannerContext.getTimeZone();
@Override public DruidExpression toDruidExpression( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { final RexCall call = (RexCall) rexNode; final RexNode timeArg = call.getOperands().get(0); final DruidExpression timeExpression = Expressions.toDruidExpression(plannerContext, rowSignature, timeArg); if (timeExpression == null) { return null; } final TimestampExtractExprMacro.Unit unit = TimestampExtractExprMacro.Unit.valueOf( StringUtils.toUpperCase(RexLiteral.stringValue(call.getOperands().get(1))) ); final DateTimeZone timeZone = call.getOperands().size() > 2 && !RexLiteral.isNullLiteral(call.getOperands().get(2)) ? DateTimes.inferTzfromString(RexLiteral.stringValue(call.getOperands().get(2))) : plannerContext.getTimeZone(); return applyTimeExtract(timeExpression, unit, timeZone); } }
} else { final String value = timeZoneArg.eval(bindings).asString(); timeZone = value != null ? DateTimes.inferTzfromString(value) : null;