You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicfunplan(statement:Statement, session:Session, onProblem:ProblemCallback = {}): Result
This is defaulted to a unit if it's not specified in the function call. The function returns a PartiQLPlanner.Result, which has a field for all the Problems:
It can be confusing to the user of the API whether they should check the ProblemCallback that they may pass in or the Result to check if any errors occurred during the ast -> plan transformation. Currently, the default PartiQLPlanner always returns an emptyList():
Currently, the
PartiQLPlanner
interface has a function calledplan
that can take aProblemCallback
:partiql-lang-kotlin/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt
Line 23 in 5bcde13
This is defaulted to a
unit
if it's not specified in the function call. The function returns aPartiQLPlanner.Result
, which has a field for all theProblem
s:partiql-lang-kotlin/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlanner.kt
Lines 25 to 33 in 5bcde13
It can be confusing to the user of the API whether they should check the
ProblemCallback
that they may pass in or theResult
to check if any errors occurred during the ast -> plan transformation. Currently, the defaultPartiQLPlanner
always returns anemptyList()
:partiql-lang-kotlin/partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerDefault.kt
Line 48 in 5bcde13
so checking the
PartiQLPlanner.Result
for an error does not check anything since it'll always be an empty list.I came across this issue when our other repo calls the
plan
function without anyProblemCallback
:https://github.com/partiql/partiql-scribe/blob/f9627257460d28f89201020d096b8f3c94be06ca/src/main/kotlin/org/partiql/scribe/ScribeCompiler.kt#L58-L65
The above code does not do any error checking following planning.
Additional Context
The text was updated successfully, but these errors were encountered: