本文整理汇总了Java中org.pentaho.di.trans.steps.selectvalues.SelectMetadataChange类的典型用法代码示例。如果您正苦于以下问题:Java SelectMetadataChange类的具体用法?Java SelectMetadataChange怎么用?Java SelectMetadataChange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectMetadataChange类属于org.pentaho.di.trans.steps.selectvalues包,在下文中一共展示了SelectMetadataChange类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSelectValueToChangeTheDataType
import org.pentaho.di.trans.steps.selectvalues.SelectMetadataChange; //导入依赖的package包/类
private StepMeta getSelectValueToChangeTheDataType(GraphConfigurationInfo graphConfiguration,
int counter) {
//
SelectValuesMeta selectValues = new SelectValuesMeta();
selectValues.allocate(0, 0, 0);
StepMeta selectValueMeta = new StepMeta(
GraphGeneratorConstants.SELECT_REQUIRED_VALUE + "Change Dimension And Measure DataType"
+ System.currentTimeMillis() + counter, (StepMetaInterface) selectValues);
xAxixLocation += 120;
selectValueMeta.setName("SelectValueToChangeChangeData");
selectValueMeta.setLocation(xAxixLocation, yAxixLocation);
selectValueMeta.setDraw(true);
selectValueMeta.setDescription(
"Change The Data Type For Measures: " + GraphGeneratorConstants.SELECT_REQUIRED_VALUE);
String inputQuery = graphConfiguration.getTableInputSqlQuery();
String[] columns = parseQueryAndReturnColumns(inputQuery);
SelectMetadataChange[] changeMeta = new SelectMetadataChange[columns.length];
Map<String, Boolean> measureDatatypeMap =
getMeasureDatatypeMap(graphConfiguration.getMeasureDataTypeInfo());
String[] measures = graphConfiguration.getMeasures();
String dimensionString = graphConfiguration.getActualDimensionColumns();
String[] dimension = dimensionString.split(CarbonCommonConstants.AMPERSAND_SPC_CHARACTER);
for (int i = 0; i < columns.length; i++) {
changeMeta[i] = new SelectMetadataChange(selectValues);
changeMeta[i].setName(columns[i]);
changeMeta[i].setType(2);
if (isMeasureColumn(measures, columns[i]) && isNotDimesnionColumn(dimension, columns[i])) {
Boolean isString = measureDatatypeMap.get(columns[i]);
if (isString != null && isString) {
changeMeta[i].setType(2);
} else {
changeMeta[i].setType(6);
}
}
changeMeta[i].setStorageType(0);
}
//
selectValues.setMeta(changeMeta);
return selectValueMeta;
}