use of com.actiontech.dble.plan.common.item.Item in project dble by actiontech.
the class ItemSumMin method toExpression.
@Override
public SQLExpr toExpression() {
Item arg0 = args.get(0);
SQLAggregateExpr aggregate = new SQLAggregateExpr(funcName());
aggregate.addArgument(arg0.toExpression());
return aggregate;
}
use of com.actiontech.dble.plan.common.item.Item in project dble by actiontech.
the class ItemSumSum method toExpression.
@Override
public SQLExpr toExpression() {
Item arg0 = getArg(0);
SQLAggregateExpr aggregate = new SQLAggregateExpr(funcName());
aggregate.addArgument(arg0.toExpression());
if (hasWithDistinct()) {
aggregate.setOption(SQLAggregateOption.DISTINCT);
}
return aggregate;
}
use of com.actiontech.dble.plan.common.item.Item in project dble by actiontech.
the class JoinHandler method makeOtherJoinOnItem.
private Item makeOtherJoinOnItem(List<FieldPacket> rowPackets, BackendConnection conn) {
this.joinRowFields = HandlerTool.createFields(rowPackets);
if (otherJoinOn == null)
return null;
Item ret = HandlerTool.createItem(this.otherJoinOn, this.joinRowFields, 0, this.isAllPushDown(), this.type());
return ret;
}
use of com.actiontech.dble.plan.common.item.Item in project dble by actiontech.
the class AllAnySubQueryHandler method rowResponse.
@Override
public boolean rowResponse(byte[] rowNull, RowDataPacket rowPacket, boolean isLeft, BackendConnection conn) {
lock.lock();
try {
if (terminate.get()) {
return true;
}
RowDataPacket row = rowPacket;
if (row == null) {
row = new RowDataPacket(this.fieldPackets.size());
row.read(rowNull);
}
sourceField.setPtr(row.getValue(0));
Item value = itemSubQuery.getFiled().getResultItem();
if (itemSubQuery.getValue().size() == 0) {
itemSubQuery.getValue().add(value);
tmpRow = row;
} else if (itemSubQuery.getValue().size() == 1) {
handleNewRow(row, value);
} else {
// ignore row
}
} finally {
lock.unlock();
}
return false;
}
use of com.actiontech.dble.plan.common.item.Item in project dble by actiontech.
the class InSubQueryHandler method rowResponse.
@Override
public boolean rowResponse(byte[] rowNull, RowDataPacket rowPacket, boolean isLeft, BackendConnection conn) {
lock.lock();
try {
if (terminate.get()) {
return true;
}
if (++rowCount > maxPartSize * maxConnSize) {
String errMessage = "sub query too much rows!";
LOGGER.info(errMessage);
genErrorPackage(ErrorCode.ER_UNKNOWN_ERROR, errMessage);
conn.close(errMessage);
try {
tempDoneCallBack.call();
} catch (Exception callback) {
LOGGER.info("callback exception!", callback);
}
return true;
}
RowDataPacket row = rowPacket;
if (row == null) {
row = new RowDataPacket(this.fieldPackets.size());
row.read(rowNull);
}
sourceField.setPtr(row.getValue(0));
Item value = itemSubQuery.getFiled().getResultItem();
if (value != null) {
itemSubQuery.getValue().add(value);
}
} finally {
lock.unlock();
}
return false;
}
Aggregations