本文整理汇总了Java中com.taobao.tddl.optimizer.core.expression.ISelectable.getDataType方法的典型用法代码示例。如果您正苦于以下问题:Java ISelectable.getDataType方法的具体用法?Java ISelectable.getDataType怎么用?Java ISelectable.getDataType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.optimizer.core.expression.ISelectable
的用法示例。
在下文中一共展示了ISelectable.getDataType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getReturnType
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
@Override
public DataType getReturnType() {
List args = this.function.getArgs();
List<ISelectable> returnColumns = null;
if (GeneralUtil.isEmpty(args)) {
throw new IllegalAccessError("impossible");
}
if (args.get(0) instanceof IQueryTree) {
returnColumns = ((IQueryTree) args.get(0)).getColumns();
} else if (args.get(0) instanceof QueryTreeNode) {
returnColumns = ((QueryTreeNode) args.get(0)).getColumnsSelected();
} else {
throw new ExecutorException("subQuery is not IQueryTree or QueryTreeNode");
}
if (returnColumns.size() != 1) {
throw new ExecutorException("only one column can be in sub query, sub query is: " + this.getQueryPlan());
}
ISelectable returnColumn = returnColumns.get(0);
return returnColumn.getDataType();
}
示例2: putRetColumnInMeta
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
void putRetColumnInMeta(ISelectable column, List<ColumnMeta> metaColumns) {
String columnName;
columnName = column.getColumnName();
DataType type = null;
// 函数在Map和Reduce过程中的返回类型可以不同
// 如Avg,map过程返回String
// reduce过程中返回数字类型
if (this.isMerge()) {
type = column.getDataType();
} else {
if (column instanceof IFunction) {
type = ((IFunction) column).getExtraFunction().getMapReturnType();
} else {
type = column.getDataType();
}
}
ColumnMeta cm = new ColumnMeta(ExecUtils.getLogicTableName(column.getTableName()),
columnName,
type,
column.getAlias(),
true);
metaColumns.add(cm);
}
示例3: getColumnMetas
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
public static List<ColumnMeta> getColumnMetas(List<ISelectable> columns) {
List<ColumnMeta> _columns = new ArrayList<ColumnMeta>(columns.size());
for (ISelectable c : columns) {
ColumnMeta ic = new ColumnMeta(c.getTableName(), c.getColumnName(), c.getDataType(), c.getAlias(), true);
_columns.add(ic);
}
return _columns;
}
示例4: getColumnMetaWithLogicTables
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
public static List<ColumnMeta> getColumnMetaWithLogicTables(List<ISelectable> columns) {
List<ColumnMeta> _columns = new ArrayList<ColumnMeta>(columns.size());
for (ISelectable c : columns) {
ColumnMeta ic = new ColumnMeta(getLogicTableName(c.getTableName()),
c.getColumnName(),
c.getDataType(),
c.getAlias(),
true);
_columns.add(ic);
// if (ic.getDataType() == null)
// throw new RuntimeException("fuck!");
}
return _columns;
}
示例5: putRetColumnInMeta
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
void putRetColumnInMeta(ISelectable column, List<ColumnMeta> metaColumns) {
String columnName;
columnName = column.getColumnName();
DataType type = null;
// 函数在Map和Reduce过程中的返回类型可以不同
// 如Avg,map过程返回String
// reduce过程中返回数字类型
if (this.isMerge()) {
type = column.getDataType();
} else {
if (column instanceof IFunction) {
if (((IFunction) column).getFunctionType().equals(FunctionType.Aggregate)) {
type = ((AggregateFunction) ((IFunction) column).getExtraFunction()).getMapReturnType();
} else {
type = column.getDataType();
}
} else {
type = column.getDataType();
}
}
ColumnMeta cm = new ColumnMeta(ExecUtils.getLogicTableName(column.getTableName()),
columnName,
type,
column.getAlias(),
true);
metaColumns.add(cm);
}
示例6: getColumnMeta
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
public static ColumnMeta getColumnMeta(Object o) {
ISelectable c = (ISelectable) o;
return new ColumnMeta(c.getTableName(), c.getColumnName(), c.getDataType(), c.getAlias(), true);
}
示例7: getColumnMetaTable
import com.taobao.tddl.optimizer.core.expression.ISelectable; //导入方法依赖的package包/类
public static ColumnMeta getColumnMetaTable(Object o, String tableName) {
ISelectable c = (ISelectable) o;
return new ColumnMeta(tableName, c.getColumnName(), c.getDataType(), c.getAlias(), true);
}