Skip to content

Commit

Permalink
Ignore types of set op schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
alancai98 committed Jul 10, 2024
1 parent 58df6f7 commit af7bc0b
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,14 @@ internal class PlanTyper(
}

/**
* @return whether each type of the [lhs] is equal to its counterpart on the [rhs]
* @return whether each type of the [lhs] is comparable to its counterpart on the [rhs]
* @param lhs should be typed already
* @param rhs should be typed already
*/
private fun setOpSchemaTypesMatch(lhs: Rel, rhs: Rel): Boolean {
// TODO: [RFC-0007](https://github.com/partiql/partiql-lang/blob/main/RFCs/0007-rfc-bag-operators.md)
// states that the types must be "comparable". The below code ONLY makes sure that types need to be
// the same. In the future, we need to add support for checking comparable types.
for (i in 0..lhs.type.schema.lastIndex) {
val lhsBindingType = lhs.type.schema[i].type
val rhsBindingType = rhs.type.schema[i].type
if (lhsBindingType != rhsBindingType) {
return false
}
}
// states that the types must be "comparable". For now, we will always return true. In the future, we need
// to add support for checking comparable types.
return true
}

Expand Down

0 comments on commit af7bc0b

Please sign in to comment.