/** * Creates a new ValidateErrorInfo with a SqlParserPos and an error * string. * * @param pos Error position * @param errorMsg Error message */ public ValidateErrorInfo( SqlParserPos pos, String errorMsg) { this.startLineNum = pos.getLineNum(); this.startColumnNum = pos.getColumnNum(); this.endLineNum = pos.getEndLineNum(); this.endColumnNum = pos.getEndColumnNum(); this.errorMsg = errorMsg; }
/** * Creates a new ValidateErrorInfo with a SqlParserPos and an error * string. * * @param pos Error position * @param errorMsg Error message */ public ValidateErrorInfo( SqlParserPos pos, String errorMsg) { this.startLineNum = pos.getLineNum(); this.startColumnNum = pos.getColumnNum(); this.endLineNum = pos.getEndLineNum(); this.endColumnNum = pos.getEndColumnNum(); this.errorMsg = errorMsg; }
/** * Wraps an exception with context. */ public static EigenbaseContextException newContextException( final SqlParserPos pos, Resources.ExInst<?> e) { int line = pos.getLineNum(); int col = pos.getColumnNum(); int endLine = pos.getEndLineNum(); int endCol = pos.getEndColumnNum(); return newContextException(line, col, endLine, endCol, e); }
/** * Combines this parser position with another to create a position which * spans from the first point in the first to the last point in the other. */ public SqlParserPos plus(SqlParserPos pos) { return new SqlParserPos( getLineNum(), getColumnNum(), pos.getEndLineNum(), pos.getEndColumnNum()); }
/** * Combines this parser position with an array of positions to create a * position which spans from the first point in the first to the last point * in the other. */ public SqlParserPos plusAll(SqlNode [] nodes) { int line = getLineNum(); int column = getColumnNum(); int endLine = getEndLineNum(); int endColumn = getEndColumnNum(); return sum(nodes, line, column, endLine, endColumn); }
/** * Wraps an exception with context. */ public static EigenbaseException newContextException( final SqlParserPos pos, Throwable e) { int line = pos.getLineNum(); int col = pos.getColumnNum(); int endLine = pos.getEndLineNum(); int endCol = pos.getEndColumnNum(); return newContextException(line, col, endLine, endCol, e); }
/** * Combines this parser position with another to create a position which * spans from the first point in the first to the last point in the other. */ public SqlParserPos plus(SqlParserPos pos) { return new SqlParserPos( getLineNum(), getColumnNum(), pos.getEndLineNum(), pos.getEndColumnNum()); }
/** * Combines this parser position with an array of positions to create a * position which spans from the first point in the first to the last point * in the other. */ public SqlParserPos plusAll(SqlNode[] nodes) { int line = getLineNum(); int column = getColumnNum(); int endLine = getEndLineNum(); int endColumn = getEndColumnNum(); return sum(nodes, line, column, endLine, endColumn); }
testColumn = pos.getEndColumnNum(); if (testLine > endLine || testLine == endLine && testColumn > endColumn) { endLine = testLine;
((SqlNode) list.get(list.size() - 1)).getParserPosition(); final int line = lastPos.getEndLineNum(); final int col = lastPos.getEndColumnNum() + 1; SqlParserPos errPos = new SqlParserPos(line, col, line, col); throw SqlUtil.newContextException(errPos, RESOURCE.betweenWithoutAnd());
testColumn = pos.getEndColumnNum(); if (testLine > endLine || testLine == endLine && testColumn > endColumn) { endLine = testLine;
((SqlNode) list.get(list.size() - 1)).getParserPosition(); final int line = lastPos.getEndLineNum(); final int col = lastPos.getEndColumnNum() + 1; SqlParserPos errPos = new SqlParserPos(line, col, line, col); throw SqlUtil.newContextException(
sql, pos.getEndLineNum(), pos.getEndColumnNum()) + 1; String param = "p" + (p++); values.add(Pair.of(sql2.substring(start, end), param));
actualColumn = spe.getPos().getColumnNum(); actualEndLine = spe.getPos().getEndLineNum(); actualEndColumn = spe.getPos().getEndColumnNum(); if (spe.getCause() != null) { actualException = spe.getCause(); || (actualColumn != sap.pos.getColumnNum()) || (actualEndLine != sap.pos.getEndLineNum()) || (actualEndColumn != sap.pos.getEndColumnNum())))
actualColumn = spe.getPos().getColumnNum(); actualEndLine = spe.getPos().getEndLineNum(); actualEndColumn = spe.getPos().getEndColumnNum(); if (spe.getCause() != null) { actualException = spe.getCause(); || (actualColumn != sap.pos.getColumnNum()) || (actualEndLine != sap.pos.getEndLineNum()) || (actualEndColumn != sap.pos.getEndColumnNum()))) { fail( "Validator threw expected "
protected void validateFeature( ResourceDefinition feature, SqlParserPos context) { if (feature == disabledFeature) { EigenbaseException ex = new EigenbaseException( FEATURE_DISABLED, null); if (context == null) { throw ex; } throw new EigenbaseContextException( "location", ex, context.getLineNum(), context.getColumnNum(), context.getEndLineNum(), context.getEndColumnNum()); } } }
testColumn = pos.getEndColumnNum(); if ((testLine > endLine) || ((testLine == endLine) && (testColumn > endColumn))) testColumn = pos.getEndColumnNum(); if ((testLine > endLine) || ((testLine == endLine) && (testColumn > endColumn)))
protected void validateFeature( Feature feature, SqlParserPos context) { if (feature.equals(disabledFeature)) { EigenbaseException ex = new EigenbaseException( FEATURE_DISABLED, null); if (context == null) { throw ex; } throw new EigenbaseContextException( "location", ex, context.getLineNum(), context.getColumnNum(), context.getEndLineNum(), context.getEndColumnNum()); } } }