@Override public boolean equals(Object object) { return this == object || object instanceof UpsertStatement && super.equals(object); }
@Override public Expression getBody() { return query.getBody(); }
@Override public void setBody(Expression body) { query.setBody(body); }
@Override public Void visit(InsertStatement insert, Integer step) throws CompilationException { out.print(skip(step) + "insert into " + datasetSymbol + generateFullName(insert.getDataverseName(), insert.getDatasetName()) + "\n"); insert.getQuery().accept(this, step); out.println(SEMICOLON); return null; }
@Override public FunctionDecl visit(FunctionDecl fd, Void arg) throws CompilationException { FunctionDecl copy = new FunctionDecl(fd.getSignature(), fd.getParamList(), (Expression) fd.getFuncBody().accept(this, arg)); copy.setSourceLocation(fd.getSourceLocation()); return copy; }
@Override public Expression visit(InsertStatement insertStatement, ILangExpression arg) throws CompilationException { Expression returnExpr = insertStatement.getReturnExpression(); if (returnExpr != null) { insertStatement.setReturnExpression(visit(returnExpr, arg)); } Query bodyQuery = insertStatement.getQuery(); bodyQuery.accept(this, arg); return null; }
@Override public Void visit(InsertStatement wc, Void arg) throws CompilationException { wc.getQuery().accept(this, arg); Expression returnExpression = wc.getReturnExpression(); if (returnExpression != null) { returnExpression.accept(this, arg); } return null; }
@Override public Expression visit(FunctionDecl fd, ILangExpression arg) throws CompilationException { fd.setFuncBody(visit(fd.getFuncBody(), fd)); return null; }
@Override public Void visit(FunctionDecl fd, Collection<VariableExpr> freeVars) throws CompilationException { fd.getFuncBody().accept(this, freeVars); return null; }
private static FunctionDecl findFuncDeclaration(FunctionSignature fid, List<FunctionDecl> sequence) { for (FunctionDecl f : sequence) { if (f.getSignature().equals(fid)) { return f; } } return null; } }
protected void validateIndexKeyFields(CreateIndexStatement stmtCreateIndex, List<Integer> keySourceIndicators, ARecordType aRecordType, ARecordType metaRecordType, List<List<String>> indexFields, List<IAType> indexFieldTypes) throws AlgebricksException { ValidateUtil.validateKeyFields(aRecordType, metaRecordType, indexFields, keySourceIndicators, indexFieldTypes, stmtCreateIndex.getIndexType()); }
public String getCompactionPolicy() { AdmObjectNode mergePolicy = getMergePolicyObject(); if (mergePolicy == null) { return null; } return mergePolicy.getOptionalString(DatasetDeclParametersUtil.MERGE_POLICY_NAME_PARAMETER_NAME); }
@Override public Void visit(InsertStatement insert, Integer step) throws CompilationException { out.print(skip(step) + "insert into " + generateFullName(insert.getDataverseName(), insert.getDatasetName()) + "\n"); insert.getQuery().accept(this, step); out.println(SEMICOLON); return null; }
@Override public Pair<ILogicalOperator, LogicalVariable> visit(Query q, Mutable<ILogicalOperator> tupSource) throws CompilationException { return q.getBody().accept(this, tupSource); }
@Override public Boolean visit(FunctionDecl fd, List<FunctionDecl> arg) throws CompilationException { // Careful, we should only do this after analyzing the graph of function // calls. Pair<Boolean, Expression> p = inlineUdfsInExpr(fd.getFuncBody(), arg); fd.setFuncBody(p.second); return p.first; }
@Override public Void visit(InsertStatement insert, Integer step) throws CompilationException { out.print(skip(step) + "insert into " + datasetSymbol + generateFullName(insert.getDataverseName(), insert.getDatasetName())); out.print("("); insert.getQuery().accept(this, step + 2); out.print(")"); out.println(SEMICOLON); return null; }
@Override public Pair<ILogicalOperator, LogicalVariable> visit(Query q, Mutable<ILogicalOperator> tupSource) throws CompilationException { return q.getBody().accept(this, tupSource); }