Skip to content

Commit

Permalink
Add test result file and fix error message margin.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Aug 17, 2017
1 parent f5d8ebb commit 38631bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,20 +174,18 @@ case class In(value: Expression, list: Seq[Expression]) extends Predicate {
|Left side columns:
|[${valExprs.map(_.sql).mkString(", ")}].
|Right side columns:
|[${sub.output.map(_.sql).mkString(", ")}].
""".stripMargin
|[${sub.output.map(_.sql).mkString(", ")}].""".stripMargin

if (valExprs.length > sub.output.length) {
TypeCheckResult.TypeCheckFailure(basicErrorMessage)
} else if (subqueryOutputNotInCondition.nonEmpty) {
val finalErrorMessage = basicErrorMessage +
s"""
| The additional output in subquery aren't used in the condition of subquery.
| Additional output:
| [${subqueryOutputNotInCondition.map(_.sql).mkString(", ")}].
| Condition:
| [${children.map(_.sql).mkString(", ")}].
""".stripMargin
|The additional output in subquery aren't used in the condition of subquery.
|Additional output:
|[${subqueryOutputNotInCondition.map(_.sql).mkString(", ")}].
|Condition:
|[${children.map(_.sql).mkString(", ")}].""".stripMargin
TypeCheckResult.TypeCheckFailure(finalErrorMessage)
} else {
val mismatchedColumns = valExprs.zip(sub.output.take(valExprs.length)).flatMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ Left side columns:
[t1.`t1a`].
Right side columns:
[t2.`t2a`, t2.`t2b`].
;
The additional output in subquery aren't used in the condition of subquery.
Additional output:
[t2.`t2b`].
Condition:
[t1.`t1a`].;


-- !query 6
Expand All @@ -102,5 +106,4 @@ number of columns in the output of subquery.
Left side columns:
[t1.`t1a`, t1.`t1b`].
Right side columns:
[t2.`t2a`].
;
[t2.`t2a`].;

0 comments on commit 38631bb

Please sign in to comment.