Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RCHowell committed Oct 20, 2023
1 parent c8fdd60 commit 11ff840
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.

This file was deleted.

3 changes: 0 additions & 3 deletions partiql-planner/src/main/kotlin/org/partiql/planner/Env.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.partiql.plan.identifierQualified
import org.partiql.plan.identifierSymbol
import org.partiql.planner.typer.FunctionResolver
import org.partiql.planner.typer.Mapping
import org.partiql.planner.typer.isNullOrMissing
import org.partiql.planner.typer.toRuntimeType
import org.partiql.spi.BindingCase
import org.partiql.spi.BindingName
Expand Down Expand Up @@ -205,7 +204,6 @@ internal class Env(
if (!hadMissingArg && arg.type.isMissable()) {
hadMissingArg = true
}
arg.type.isNullOrMissing()
FunctionParameter("arg-$i", arg.type.toRuntimeType())
}
val match = functionResolver.match(candidates, parameters)
Expand All @@ -228,7 +226,6 @@ internal class Env(
if (!hadMissingArg && arg.type.isMissable()) {
hadMissingArg = true
}
arg.type.isNullOrMissing()
FunctionParameter("arg-$i", arg.type.toRuntimeType())
}
val match = functionResolver.match(candidates, parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ internal class PlanTyper(
var missingArg = false
val args = arguments.map {
val arg = visitRex(it, null)
if (arg.type == MissingType) missingArg = true
if (arg.type.isMissable()) missingArg = true
arg
}

Expand All @@ -989,7 +989,7 @@ internal class PlanTyper(

// Some operators can return MISSING during runtime
if (match.isMissable) {
type = StaticType.unionOf(type, StaticType.MISSING)
type = StaticType.unionOf(type, StaticType.MISSING).flatten()
}

// Finally, rewrite this node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public sealed class FunctionSignature(
other.name != name ||
other.returns != returns ||
other.parameters.size != parameters.size ||
other.isDecomposable != isDecomposable
other.isDecomposable != isDecomposable ||
other.isNullable != isNullable
) {
return false
}
Expand All @@ -131,12 +132,12 @@ public sealed class FunctionSignature(
result = 31 * result + returns.hashCode()
result = 31 * result + parameters.hashCode()
result = 31 * result + isDecomposable.hashCode()
result = 31 * result + isNullable.hashCode()
result = 31 * result + (description?.hashCode() ?: 0)
return result
}
}


// // Logic for writing a [FunctionSignature] using SQL `CREATE FUNCTION` syntax.
//
// /**
Expand Down

0 comments on commit 11ff840

Please sign in to comment.