Create a new DateTimeExpression

@param expr the date time Expression
@return new DateTimeExpression
480073
public static <T extends Comparable<?>> DateTimeExpression<T> asDateTime(Expression<T> expr) {
        Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
        if (underlyingMixin instanceof PathImpl) {
            return new DateTimePath<T>((PathImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof OperationImpl) {
            return new DateTimeOperation<T>((OperationImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof TemplateExpressionImpl) {
            return new DateTimeTemplate<T>((TemplateExpressionImpl<T>) underlyingMixin);
        } else {
            return new DateTimeExpression<T>(underlyingMixin) {

                private static final long serialVersionUID = 8007203530480765244L;

                @Override
                public <R, C> R accept(Visitor<R, C> v, C context) {
                    return this.mixin.accept(v, context);
                }

            };
        }

    }
1208683
public static Object execExpr(ExprResolver exprResolver, String expression) {

        try {
            // 返回输出的内容
            return exprResolver.executeExpr(expression);

        } catch (Exception e) {

            // 输出日志
            if (logger.isDebugEnabled()) {
                logger.debug("Can't resolving expression: " + expression, e);
            }
        }

        return null;
    }
767313
public static <T> WindowOver<T> ratioToReport(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), SQLOps.RATIOTOREPORT, expr);
    }
462559
public static <T extends Comparable> DateTimeExpression<T> currentTimestamp(Class<T> cl) {
        return Expressions.dateTimeOperation(cl, Ops.DateTimeOps.CURRENT_TIMESTAMP);
    }
349872
public static <T> PositionFactory<T> at(String expr) {
        return new PositionFactory<>(Validate.notEmpty(expr, "expr"));
    }
414740
public static <T extends Number> WindowOver<T> stddevPop(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), SQLOps.STDDEVPOP, expr);
    }
872824
public static <T extends Comparable> WindowOver<T> min(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), Ops.AggOps.MIN_AGG, expr);
    }
397900
public static <D extends Comparable> DateTimeExpression<D> addHours(DateTimeExpression<D> date, int hours) {
        return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_HOURS, date, ConstantImpl.create(hours));
    }
31118
public static Extractor createExtractor(String expression) {
        try {
            return INSTANCE.ctorExtractor.newInstance(expression);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
115075
public static <T> Expression<T> list(Class<T> clazz, Expression<?>... exprs) {
        return list(clazz, ImmutableList.copyOf(exprs));
    }
848241
public static <T> WindowOver<T> lag(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), SQLOps.LAG, expr);
    }
1134921
public static ExprDouble toExprDouble(Expression expr) {
	if (expr instanceof ExprDouble) return (ExprDouble) expr;
	if (expr instanceof Literal) {
	    Double dbl = ((Literal) expr).getDouble(null);
	    if (dbl != null) return expr.getFactory().createLitDouble(dbl.doubleValue(), expr.getStart(), expr.getEnd());
	}
	return new CastDouble(expr);
    }
819145
public static <D extends Comparable> DateTimeExpression<D> addMinutes(DateTimeExpression<D> date, int minutes) {
        return Expressions.dateTimeOperation(date.getType(), Ops.DateTimeOps.ADD_MINUTES, date, ConstantImpl.create(minutes));
    }
1056969
public static <T extends Comparable> DateTimeExpression<T> currentDate(Class<T> cl) {
        return Expressions.dateTimeOperation(cl, Ops.DateTimeOps.CURRENT_DATE);
    }
707307
public static WindowOver<Long> count(Expression<?> expr) {
        return new WindowOver<Long>(Long.class, Ops.AggOps.COUNT_AGG, expr);
    }
1290904
public static <D extends Comparable> DateExpression<D> dateadd(DatePart unit, DateExpression<D> date, int amount) {
        return Expressions.dateOperation(date.getType(), DATE_ADD_OPS.get(unit), date, ConstantImpl.create(amount));
    }
57847
public static <T extends Number> WindowOver<T> avg(Expression<T> expr) {
        return new WindowOver<T>(expr.getType(), Ops.AggOps.AVG_AGG, expr);
    }