public class TiDAGRequest extends Object implements Serializable
Used for constructing a new DAG request to TiKV
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TiDAGRequest.Builder |
static class |
TiDAGRequest.IndexScanType |
static class |
TiDAGRequest.PushDownType
Whether we use streaming to push down the request
|
static class |
TiDAGRequest.TruncateMode |
| 构造器和说明 |
|---|
TiDAGRequest(TiDAGRequest.PushDownType pushDownType) |
TiDAGRequest(TiDAGRequest.PushDownType pushDownType,
EncodeType encodeType,
int timeZoneOffset) |
TiDAGRequest(TiDAGRequest.PushDownType pushDownType,
int timeZoneOffset) |
| 限定符和类型 | 方法和说明 |
|---|---|
TiDAGRequest |
addAggregate(AggregateFunction expr) |
void |
addDowngradeFilter(Expression filter) |
TiDAGRequest |
addFilters(List<Expression> filters) |
TiDAGRequest |
addGroupByItem(ByItem byItem)
add a group by clause to select query
|
TiDAGRequest |
addOrderByItem(ByItem byItem)
add a order by clause to select query.
|
TiDAGRequest |
addRanges(Map<Long,List<Coprocessor.KeyRange>> ranges)
set key range of scan
|
TiDAGRequest |
addRequiredColumn(ColumnRef column)
Field is not support in TiDB yet, for here we simply allow TiColumnRef instead of TiExpr like
in SelectRequest proto
This interface allows duplicate columns and it's user's responsibility to do dedup since we
need to ensure exact order and items preserved during decoding
|
DAGRequest |
buildIndexScan() |
DAGRequest |
buildTableScan() |
void |
clearIndexInfo() |
TiDAGRequest |
copy() |
TiDAGRequest |
copyReqWithPhysicalId(long id) |
List<Expression> |
getDowngradeFilters() |
EncodeType |
getEncodeType() |
double |
getEstimatedCount()
Get the estimated row count will be fetched from this request.
|
List<ColumnRef> |
getFields() |
List<Expression> |
getFilters() |
List<ByItem> |
getGroupByItems() |
List<DataType> |
getIndexDataTypes() |
TiIndexInfo |
getIndexInfo() |
TiDAGRequest.IndexScanType |
getIndexScanType() |
int |
getLimit() |
long |
getPhysicalId() |
List<TiPartitionDef> |
getPrunedParts() |
List<Long> |
getPrunedPhysicalIds() |
List<AggregateFunction> |
getPushDownAggregates() |
List<ByItem> |
getPushDownGroupBys() |
List<ByItem> |
getPushDownOrderBys() |
TiDAGRequest.PushDownType |
getPushDownType()
Whether we use streaming processing to retrieve data
|
List<Coprocessor.KeyRange> |
getRangesByPhysicalId(long physicalId) |
Map<Long,List<Coprocessor.KeyRange>> |
getRangesMaps() |
TiTimestamp |
getStartTs() |
TiStoreType |
getStoreType() |
TiTableInfo |
getTableInfo() |
boolean |
hasIndex()
Returns whether this request is of indexScanType
|
boolean |
hasPushDownAggregate()
Check whether the DAG request has any aggregate expression.
|
boolean |
hasPushDownGroupBy()
Check whether the DAG request has any group by expression.
|
void |
init(boolean readHandle) |
boolean |
isDistinct() |
boolean |
isDoubleRead()
Returns whether needs to read handle from index first and find its corresponding row. i.e,
"double read"
|
void |
resetFilters(List<Expression> filters) |
TiDAGRequest |
setDistinct(boolean distinct) |
void |
setEncodeType(EncodeType encodeType) |
void |
setEstimatedCount(double estimatedCount)
Set the estimated row count will be fetched from this request.
|
TiDAGRequest |
setHaving(Expression having)
set having clause to select query
|
TiDAGRequest |
setIndexInfo(TiIndexInfo indexInfo) |
void |
setIsDoubleRead(boolean isDoubleRead)
Sets isDoubleRead
|
TiDAGRequest |
setLimit(int limit)
add limit clause to select query.
|
TiDAGRequest |
setPhysicalId(long id) |
void |
setPrunedParts(List<TiPartitionDef> prunedParts) |
TiDAGRequest |
setStartTs(TiTimestamp startTs)
set start timestamp for the transaction
|
void |
setStoreType(TiStoreType storeType) |
TiDAGRequest |
setTableInfo(TiTableInfo tableInfo) |
String |
toString() |
public TiDAGRequest(TiDAGRequest.PushDownType pushDownType)
public TiDAGRequest(TiDAGRequest.PushDownType pushDownType, EncodeType encodeType, int timeZoneOffset)
public TiDAGRequest(TiDAGRequest.PushDownType pushDownType, int timeZoneOffset)
public List<TiPartitionDef> getPrunedParts()
public void setPrunedParts(List<TiPartitionDef> prunedParts)
public TiStoreType getStoreType()
public void setStoreType(TiStoreType storeType)
public EncodeType getEncodeType()
public void setEncodeType(EncodeType encodeType)
public DAGRequest buildIndexScan()
public DAGRequest buildTableScan()
public TiTableInfo getTableInfo()
public TiDAGRequest setTableInfo(TiTableInfo tableInfo)
public long getPhysicalId()
public TiDAGRequest setPhysicalId(long id)
public TiIndexInfo getIndexInfo()
public TiDAGRequest setIndexInfo(TiIndexInfo indexInfo)
public void clearIndexInfo()
public int getLimit()
public TiDAGRequest setLimit(int limit)
limit - is just a integer.public TiTimestamp getStartTs()
public TiDAGRequest setStartTs(@Nonnull TiTimestamp startTs)
startTs - timestamppublic TiDAGRequest setHaving(Expression having)
having - is a expression represents Havingpublic boolean isDistinct()
public TiDAGRequest setDistinct(boolean distinct)
public TiDAGRequest addAggregate(AggregateFunction expr)
public TiDAGRequest addOrderByItem(ByItem byItem)
byItem - is a TiByItem.public TiDAGRequest addGroupByItem(ByItem byItem)
byItem - is a TiByItempublic TiDAGRequest addRequiredColumn(ColumnRef column)
This interface allows duplicate columns and it's user's responsibility to do dedup since we need to ensure exact order and items preserved during decoding
column - is column referred during selectReqpublic TiDAGRequest addRanges(Map<Long,List<Coprocessor.KeyRange>> ranges)
ranges - key range of scanpublic void resetFilters(List<Expression> filters)
public List<Coprocessor.KeyRange> getRangesByPhysicalId(long physicalId)
public Map<Long,List<Coprocessor.KeyRange>> getRangesMaps()
public TiDAGRequest addFilters(List<Expression> filters)
public List<Expression> getFilters()
public void addDowngradeFilter(Expression filter)
public List<Expression> getDowngradeFilters()
public List<AggregateFunction> getPushDownAggregates()
public boolean hasPushDownAggregate()
public boolean hasPushDownGroupBy()
public boolean isDoubleRead()
public void setIsDoubleRead(boolean isDoubleRead)
isDoubleRead - if is double readpublic boolean hasIndex()
public TiDAGRequest.PushDownType getPushDownType()
public double getEstimatedCount()
public void setEstimatedCount(double estimatedCount)
public void init(boolean readHandle)
public TiDAGRequest.IndexScanType getIndexScanType()
public TiDAGRequest copy()
public TiDAGRequest copyReqWithPhysicalId(long id)
Copyright © 2023 PingCAP. All rights reserved.