Skip to content

Commit

Permalink
Fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmyMiao87 committed Mar 20, 2020
1 parent 13c8799 commit 1581b3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Expand Up @@ -219,7 +219,7 @@ private static SelectStmt rewriteHavingClauseSubqueries(SelectStmt stmt, Analyze
ArrayList<OrderByElement> newOrderByElements = null;
if (orderByElements != null) {
newOrderByElements = OrderByElement.substitute(orderByElements, smap, analyzer);
LOG.debug("Order by is changed to " + Joiner.on(",").join(newOrderByElements);
LOG.debug("Order by is changed to " + Joiner.on(",").join(newOrderByElements));
}

// construct rewritten query
Expand Down
Expand Up @@ -17,9 +17,13 @@

package org.apache.doris.analysis;

import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;

import org.apache.doris.common.jmockit.Deencapsulation;

import com.google.common.collect.Lists;

import org.junit.Assert;
import org.junit.Test;

Expand Down Expand Up @@ -52,12 +56,16 @@ public void testMultiColumnSubquery(@Injectable Expr child0,

@Test
public void testSingleColumnSubquery(@Injectable Expr child0,
@Injectable Subquery child1) {
@Injectable QueryStmt subquery,
@Injectable SlotRef slotRef) {
Subquery child1 = new Subquery(subquery);
BinaryPredicate binaryPredicate = new BinaryPredicate(BinaryPredicate.Operator.EQ, child0, child1);
new Expectations() {
{
child1.returnsScalarColumn();
result = true;
subquery.getResultExprs();
result = Lists.newArrayList(slotRef);
slotRef.getType();
result = Type.INT;
}
};

Expand All @@ -68,4 +76,4 @@ public void testSingleColumnSubquery(@Injectable Expr child0,
Assert.fail(e.getMessage());
}
}
}
}

0 comments on commit 1581b3d

Please sign in to comment.