本文整理汇总了Java中com.taobao.tddl.executor.utils.ExecUtils.getIColumn方法的典型用法代码示例。如果您正苦于以下问题:Java ExecUtils.getIColumn方法的具体用法?Java ExecUtils.getIColumn怎么用?Java ExecUtils.getIColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.executor.utils.ExecUtils
的用法示例。
在下文中一共展示了ExecUtils.getIColumn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setIntoRowSet
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
private void setIntoRowSet(ICursorMeta cursorMetaNew, IBooleanFilter bf, IRowSet rowSet,
ColumnEQProcessor columnProcessor) {
IColumn col = ExecUtils.getIColumn(bf.getColumn());
Object val = bf.getValue();
// if (col.getDataType() == DATA_TYPE.DATE_VAL) {
// if (val instanceof Long) {
// val = new Date((Long) val);
// }
// }
val = processFunction(val);
val = columnProcessor.process(val, col.getDataType());
Integer inte = cursorMetaNew.getIndex(col.getTableName(), col.getColumnName());
if (inte == null) inte = cursorMetaNew.getIndex(col.getTableName(), col.getAlias());
rowSet.setObject(inte, val);
}
示例2: isTwoOrderByMatched
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
/**
* 比较两个排序,排序可不相同
*
* @param o1
* @param o2
* @return
*/
protected static boolean isTwoOrderByMatched(IOrderBy o1, IOrderBy o2) {
IColumn c1 = ExecUtils.getIColumn(o1.getColumn());
IColumn c2 = ExecUtils.getIColumn(o2.getColumn());
boolean columnMatch = c1 != null
&& c2 != null
&& (StringUtils.equals(c1.getTableName(), c2.getTableName()))
&& (c1.getColumnName().equals(c2.getColumnName()) || (c1.getAlias() != null && c1.getAlias()
.equals(c2.getColumnName())));
return columnMatch;
}
示例3: setIntoRowSet
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
protected void setIntoRowSet(ICursorMeta cursorMetaNew, IBooleanFilter bf, IRowSet rowSet,
ColumnEQProcessor columnProcessor) {
IColumn col = ExecUtils.getIColumn(bf.getColumn());
Object val = bf.getValue();
val = processFunction(val);
val = columnProcessor.process(val, col.getDataType());
Integer inte = cursorMetaNew.getIndex(col.getTableName(), col.getColumnName(), col.getAlias());
rowSet.setObject(inte, val);
}
示例4: initAliasSchema
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
private void initAliasSchema(List<ISelectable> retColumns, String tableAlias, ICursorMeta cursormeta)
throws TddlException {
if (schemaInited) {
return;
}
colMessages = new ArrayList<ColumnMeta>(retColumns.size());
List<Integer> indexes = new ArrayList<Integer>(colMessages.size());
for (ISelectable col : retColumns) {
ColumnMeta cm = null;
String tableName = col.getTableName();
if (tableAlias != null) {
if (tableName == null || tableAlias.startsWith(tableName)) {
// 如果以tableName作为开始,那么认为认为是相同名字,因此也做截断处理,取alias的.之前的数据。
// 最好也让优化器协助,不允许在alias里面出现"."
tableAlias = ExecUtils.getLogicTableName(tableAlias);
}
}
if (!TStringUtil.isBlank(col.getAlias())) {
if (TStringUtil.isBlank(tableAlias)) {
cm = ExecUtils.getColumnMeta(col, col.getAlias());
} else {
cm = ExecUtils.getColumnMeta(col, tableAlias, col.getAlias());
}
} else {
if (TStringUtil.isBlank(tableAlias)) {
cm = ExecUtils.getColumnMeta(col);
} else {
cm = ExecUtils.getColumnMetaTable(col, tableAlias);
}
}
Integer index = cursormeta.getIndex(col.getTableName(), col.getColumnName(), col.getAlias());
if (index != null) {
indexes.add(index);
colMessages.add(cm);
}
}
if (!TStringUtil.isBlank(tableAlias)) {
// 如果没有就用下层的tableName
newMeta = CursorMetaImp.buildNew(colMessages, indexes, cursormeta.getIndexRange());
List<IOrderBy> obOld = getOrderBy();
if (obOld != null) {
List<IOrderBy> obNew = new ArrayList<IOrderBy>(obOld.size());
for (IOrderBy orderBy : obOld) {
IColumn icol = ExecUtils.getIColumn(orderBy.getColumn());
IColumn icolNew = icol.copy();
obNew.add(ASTNodeFactory.getInstance()
.createOrderBy()
.setColumn(icolNew.setTableName(tableAlias).setAlias(null))
.setDirection(orderBy.getDirection()));
}
setOrderBy(obNew);
}
} else {
newMeta = CursorMetaImp.buildNew(colMessages, indexes, cursormeta.getIndexRange());
}
schemaInited = true;
}
示例5: initAliasSchema
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
private void initAliasSchema(List<ISelectable> retColumns, String tableAlias, ICursorMeta cursormeta) {
if (schemaInited) {
return;
}
colMessages = new ArrayList<ColumnMeta>(retColumns.size());
List<Integer> indexes = new ArrayList<Integer>(colMessages.size());
for (ISelectable col : retColumns) {
ColumnMeta cm = null;
String tableName = col.getTableName();
if (tableAlias != null) {
if (tableName == null || tableAlias.startsWith(tableName)) {
// 如果以tableName作为开始,那么认为认为是相同名字,因此也做截断处理,取alias的.之前的数据。
// 最好也让优化器协助,不允许在alias里面出现"."
tableAlias = ExecUtils.getLogicTableName(tableAlias);
}
}
if (!TStringUtil.isBlank(col.getAlias())) {
if (TStringUtil.isBlank(tableAlias)) {
cm = ExecUtils.getColumnMeta(col, col.getAlias());
} else {
cm = ExecUtils.getColumnMeta(col, tableAlias, col.getAlias());
}
} else {
if (TStringUtil.isBlank(tableAlias)) {
cm = ExecUtils.getColumnMeta(col);
} else {
cm = ExecUtils.getColumnMetaTable(col, tableAlias);
}
}
Integer index = cursormeta.getIndex(col.getTableName(), col.getColumnName());
if (index == null) {
index = cursormeta.getIndex(col.getTableName(), col.getAlias());
}
if (index != null) {
indexes.add(index);
colMessages.add(cm);
}
}
if (!TStringUtil.isBlank(tableAlias)) {
// 如果没有就用下层的tableName
newMeta = CursorMetaImp.buildNew(colMessages, indexes, cursormeta.getIndexRange());
List<IOrderBy> obOld = getOrderBy();
if (obOld != null) {
List<IOrderBy> obNew = new ArrayList<IOrderBy>(obOld.size());
for (IOrderBy orderBy : obOld) {
IColumn icol = ExecUtils.getIColumn(orderBy.getColumn());
IColumn icolNew = icol.copy();
obNew.add(ASTNodeFactory.getInstance()
.createOrderBy()
.setColumn(icolNew.setTableName(tableAlias).setAlias(null))
.setDirection(orderBy.getDirection()));
}
setOrderBy(obNew);
}
} else {
newMeta = CursorMetaImp.buildNew(colMessages, indexes, cursormeta.getIndexRange());
}
schemaInited = true;
}