/** * Creates a new CalciteContextException object. * * @param message error message * @param cause underlying cause, must not be null * @param posLine 1-based start line number * @param posColumn 1-based start column number * @param endPosLine 1-based end line number * @param endPosColumn 1-based end column number */ public CalciteContextException( String message, Throwable cause, int posLine, int posColumn, int endPosLine, int endPosColumn) { super(message, cause); assert cause != null; setPosition(posLine, posColumn, endPosLine, endPosColumn); }
/** * Creates a new CalciteContextException object. * * @param message error message * @param cause underlying cause, must not be null * @param posLine 1-based start line number * @param posColumn 1-based start column number * @param endPosLine 1-based end line number * @param endPosColumn 1-based end column number */ public CalciteContextException( String message, Throwable cause, int posLine, int posColumn, int endPosLine, int endPosColumn) { super(message, cause); assert cause != null; setPosition(posLine, posColumn, endPosLine, endPosColumn); }
/** * Wraps an exception with context. */ public static CalciteContextException newContextException( int line, int col, int endLine, int endCol, Resources.ExInst<?> e) { CalciteContextException contextExcn = (line == endLine && col == endCol ? RESOURCE.validatorContextPoint(line, col) : RESOURCE.validatorContext(line, col, endLine, endCol)).ex(e.ex()); contextExcn.setPosition(line, col, endLine, endCol); return contextExcn; }
/** * Wraps an exception with context. */ public static CalciteContextException newContextException( int line, int col, int endLine, int endCol, Resources.ExInst<?> e) { CalciteContextException contextExcn = (line == endLine && col == endCol ? RESOURCE.validatorContextPoint(line, col) : RESOURCE.validatorContext(line, col, endLine, endCol)).ex(e.ex()); contextExcn.setPosition(line, col, endLine, endCol); return contextExcn; }
@Override public void validateAggregateParams(SqlCall aggCall, SqlNode filter, SqlValidatorScope scope) { if (filter != null) { Exception e = new SqlValidatorException("Dremio does not currently support aggregate functions with a filter clause", null); SqlParserPos pos = filter.getParserPosition(); CalciteContextException ex = RESOURCE.validatorContextPoint(pos.getLineNum(), pos.getColumnNum()).ex(e); ex.setPosition(pos.getLineNum(), pos.getColumnNum()); throw ex; } super.validateAggregateParams(aggCall, filter, scope); } }