Skip to content

Commit

Permalink
Merge 6bb0cb6 into a58c7d5
Browse files Browse the repository at this point in the history
  • Loading branch information
RCHowell authored Mar 19, 2024
2 parents a58c7d5 + 6bb0cb6 commit f57111f
Show file tree
Hide file tree
Showing 7 changed files with 1,113 additions and 52 deletions.
14 changes: 13 additions & 1 deletion partiql-cli/src/main/kotlin/org/partiql/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@

package org.partiql.cli

import AstPrinter
import com.amazon.ion.system.IonSystemBuilder
import com.amazon.ion.system.IonTextWriterBuilder
import org.partiql.cli.pico.PartiQLCommand
import org.partiql.cli.shell.info
import org.partiql.lang.eval.EvaluationSession
import org.partiql.parser.PartiQLParser
import org.partiql.plan.Statement
import org.partiql.plan.debug.PlanPrinter
import org.partiql.planner.PartiQLPlanner
import org.partiql.plugins.local.LocalConnector
import org.partiql.plugins.local.toIon
import picocli.CommandLine
import java.io.PrintStream
import java.nio.file.Paths
Expand Down Expand Up @@ -80,6 +82,16 @@ object Debug {
out.info("-- Plan ----------")
PlanPrinter.append(out, result.statement)

when (val plan = result.statement) {
is Statement.Query -> {
out.info("-- Schema ----------")
val outputSchema = java.lang.StringBuilder()
val ionWriter = IonTextWriterBuilder.minimal().withPrettyPrinting().build(outputSchema)
plan.root.type.toIon().writeTo(ionWriter)
out.info(outputSchema.toString())
}
}

return "OK"
}
}
Loading

0 comments on commit f57111f

Please sign in to comment.