Search in sources :

Example 1 with AQLToSQLPPPrintVisitor

use of org.apache.asterix.lang.aql.visitor.AQLToSQLPPPrintVisitor in project asterixdb by apache.

the class AQLFormatPrintUtil method toSQLPPString.

public static String toSQLPPString(List<Statement> exprs) throws CompilationException {
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    PrintWriter output = new PrintWriter(bos);
    AQLToSQLPPPrintVisitor visitor = new AQLToSQLPPPrintVisitor(output);
    for (Statement expr : exprs) {
        expr.accept(visitor, 0);
    }
    output.close();
    return bos.toString();
}
Also used : Statement(org.apache.asterix.lang.common.base.Statement) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AQLToSQLPPPrintVisitor(org.apache.asterix.lang.aql.visitor.AQLToSQLPPPrintVisitor) PrintWriter(java.io.PrintWriter)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintWriter (java.io.PrintWriter)1 AQLToSQLPPPrintVisitor (org.apache.asterix.lang.aql.visitor.AQLToSQLPPPrintVisitor)1 Statement (org.apache.asterix.lang.common.base.Statement)1