• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SelectValuesMeta类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta的典型用法代码示例。如果您正苦于以下问题:Java SelectValuesMeta类的具体用法?Java SelectValuesMeta怎么用?Java SelectValuesMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SelectValuesMeta类属于org.pentaho.di.trans.steps.selectvalues包,在下文中一共展示了SelectValuesMeta类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: generateSelectStep

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
private StepMeta generateSelectStep() {
  // Only rename the non function fields
  //
  List<SQLField> fields = sql.getSelectFields().getRegularFields();

  SelectValuesMeta meta = new SelectValuesMeta();
  meta.allocate(fields.size(), 0, 0);
  for (int i=0;i<fields.size();i++) {
    SQLField sqlField = fields.get(i);
    meta.getSelectName()[i] = sqlField.getField(); 
    meta.getSelectRename()[i] = sqlField.getAlias();
  }
  
  StepMeta stepMeta = new StepMeta("Select values", meta);
  stepMeta.setLocation(xLocation, 50);
  xLocation+=100;
  stepMeta.setDraw(true);
  return stepMeta;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:20,代码来源:SqlTransMeta.java


示例2: getSelectValueToChangeTheDataType

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的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;
}
 
开发者ID:carbondata,项目名称:carbondata,代码行数:44,代码来源:GraphGenerator.java


示例3: SelectValuesDialog

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
public SelectValuesDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
	super(parent, (BaseStepMeta)in, transMeta, sname);
	input=(SelectValuesMeta)in;
       inputFields =new HashMap<String, Integer>();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:7,代码来源:SelectValuesDialog.java


示例4: generateFieldMapping

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
/**
 * Create a new SelectValues step in between this step and the previous. If
 * the previous fields are not there, no mapping can be made, same with the
 * required fields.
 * 
 * @param stepMeta
 *            The target step to map against.
 */
@SuppressWarnings("deprecation") // retry of required fields acquisition
public void generateFieldMapping(TransMeta transMeta, StepMeta stepMeta) {
	try {
		if (stepMeta != null) {
			StepMetaInterface smi = stepMeta.getStepMetaInterface();
			RowMetaInterface targetFields = smi.getRequiredFields(transMeta);
			if (targetFields.isEmpty()) smi.getRequiredFields(); // retry, get rid of this method in 4.x
			RowMetaInterface sourceFields = transMeta.getPrevStepFields(stepMeta);

			// Build the mapping: let the user decide!!
			String[] source = sourceFields.getFieldNames();
			for (int i = 0; i < source.length; i++) {
				ValueMetaInterface v = sourceFields.getValueMeta(i);
				source[i] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
			}
			String[] target = targetFields.getFieldNames();

			EnterMappingDialog dialog = new EnterMappingDialog(shell, source, target);
			List<SourceToTargetMapping> mappings = dialog.open();
			if (mappings != null) {
				// OK, so we now know which field maps where.
				// This allows us to generate the mapping using a
				// SelectValues Step...
				SelectValuesMeta svm = new SelectValuesMeta();
				svm.allocate(mappings.size(), 0, 0);

				for (int i = 0; i < mappings.size(); i++) {
					SourceToTargetMapping mapping = mappings.get(i);
					svm.getSelectName()[i] = sourceFields.getValueMeta(mapping.getSourcePosition()).getName();
					svm.getSelectRename()[i] = target[mapping.getTargetPosition()];
					svm.getSelectLength()[i] = -1;
					svm.getSelectPrecision()[i] = -1;
				}
				// a new comment
				// Now that we have the meta-data, create a new step info
				// object

				String stepName = stepMeta.getName() + " Mapping";
				stepName = transMeta.getAlternativeStepname(stepName); // if it's already there, rename it.

				StepMeta newStep = new StepMeta("SelectValues", stepName, svm);
				newStep.setLocation(stepMeta.getLocation().x + 20, stepMeta.getLocation().y + 20);
				newStep.setDraw(true);

				transMeta.addStep(newStep);
				addUndoNew(transMeta, new StepMeta[] { newStep }, new int[] { transMeta.indexOfStep(newStep) });

				// Redraw stuff...
				refreshTree();
				refreshGraph();
			}
		} else {
			throw new KettleException("There is no target to do a field mapping against!");
		}
	} catch (KettleException e) {
		new ErrorDialog(shell, "Error creating mapping", "There was an error when Kettle tried to generate a field mapping against the target step", e);
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:67,代码来源:Spoon.java


示例5: generateFieldMapping

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
/**
 * Create a new SelectValues step in between this step and the previous. If
 * the previous fields are not there, no mapping can be made, same with the
 * required fields.
 * 
 * @param stepMeta
 *            The target step to map against.
 */
// retry of required fields acquisition
public void generateFieldMapping(TransMeta transMeta, StepMeta stepMeta) {
  try {
    if (stepMeta != null) {
      StepMetaInterface smi = stepMeta.getStepMetaInterface();
      RowMetaInterface targetFields = smi.getRequiredFields(transMeta);
      RowMetaInterface sourceFields = transMeta.getPrevStepFields(stepMeta);

      // Build the mapping: let the user decide!!
      String[] source = sourceFields.getFieldNames();
      for (int i = 0; i < source.length; i++) {
        ValueMetaInterface v = sourceFields.getValueMeta(i);
        source[i] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
      }
      String[] target = targetFields.getFieldNames();

      EnterMappingDialog dialog = new EnterMappingDialog(shell, source, target);
      List<SourceToTargetMapping> mappings = dialog.open();
      if (mappings != null) {
        // OK, so we now know which field maps where.
        // This allows us to generate the mapping using a
        // SelectValues Step...
        SelectValuesMeta svm = new SelectValuesMeta();
        svm.allocate(mappings.size(), 0, 0);

        for (int i = 0; i < mappings.size(); i++) {
          SourceToTargetMapping mapping = mappings.get(i);
          svm.getSelectName()[i] = sourceFields.getValueMeta(mapping.getSourcePosition()).getName();
          svm.getSelectRename()[i] = target[mapping.getTargetPosition()];
          svm.getSelectLength()[i] = -1;
          svm.getSelectPrecision()[i] = -1;
        }
        // a new comment
        // Now that we have the meta-data, create a new step info
        // object

        String stepName = stepMeta.getName() + " Mapping";
        stepName = transMeta.getAlternativeStepname(stepName); // if
        // it's
        // already
        // there,
        // rename
        // it.

        StepMeta newStep = new StepMeta("SelectValues", stepName, svm);
        newStep.setLocation(stepMeta.getLocation().x + 20, stepMeta.getLocation().y + 20);
        newStep.setDraw(true);

        transMeta.addStep(newStep);
        addUndoNew(transMeta, new StepMeta[] { newStep }, new int[] { transMeta.indexOfStep(newStep) });

        // Redraw stuff...
        refreshTree();
        refreshGraph();
      }
    } else {
      throw new KettleException("There is no target to do a field mapping against!");
    }
  } catch (KettleException e) {
    new ErrorDialog(shell, "Error creating mapping",
        "There was an error when Kettle tried to generate a field mapping against the target step", e);
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:72,代码来源:Spoon.java


示例6: SelectValuesDialog

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
public SelectValuesDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
  super( parent, (BaseStepMeta) in, transMeta, sname );
  input = (SelectValuesMeta) in;
  inputFields = new HashMap<String, Integer>();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:6,代码来源:SelectValuesDialog.java


示例7: generateFieldMapping

import org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta; //导入依赖的package包/类
/**
 * Create a new SelectValues step in between this step and the previous. If the previous fields are not there, no
 * mapping can be made, same with the required fields.
 *
 * @param stepMeta
 *          The target step to map against.
 */
// retry of required fields acquisition
public void generateFieldMapping( TransMeta transMeta, StepMeta stepMeta ) {
  try {
    if ( stepMeta != null ) {
      StepMetaInterface smi = stepMeta.getStepMetaInterface();
      RowMetaInterface targetFields = smi.getRequiredFields( transMeta );
      RowMetaInterface sourceFields = transMeta.getPrevStepFields( stepMeta );

      // Build the mapping: let the user decide!!
      String[] source = sourceFields.getFieldNames();
      for ( int i = 0; i < source.length; i++ ) {
        ValueMetaInterface v = sourceFields.getValueMeta( i );
        source[i] += EnterMappingDialog.STRING_ORIGIN_SEPARATOR + v.getOrigin() + ")";
      }
      String[] target = targetFields.getFieldNames();

      EnterMappingDialog dialog = new EnterMappingDialog( shell, source, target );
      List<SourceToTargetMapping> mappings = dialog.open();
      if ( mappings != null ) {
        // OK, so we now know which field maps where.
        // This allows us to generate the mapping using a
        // SelectValues Step...
        SelectValuesMeta svm = new SelectValuesMeta();
        svm.allocate( mappings.size(), 0, 0 );

        //CHECKSTYLE:Indentation:OFF
        for ( int i = 0; i < mappings.size(); i++ ) {
          SourceToTargetMapping mapping = mappings.get( i );
          svm.getSelectFields()[i].setName( sourceFields.getValueMeta( mapping.getSourcePosition() ).getName() );
          svm.getSelectFields()[i].setRename( target[mapping.getTargetPosition()] );
          svm.getSelectFields()[i].setLength( -1 );
          svm.getSelectFields()[i].setPrecision( -1 );
        }
        // a new comment. Sincerely yours CO ;)
        // Now that we have the meta-data, create a new step info object
        String stepName = stepMeta.getName() + " Mapping";
        stepName = transMeta.getAlternativeStepname( stepName ); // if
        // it's already there, rename it.

        StepMeta newStep = new StepMeta( "SelectValues", stepName, svm );
        newStep.setLocation( stepMeta.getLocation().x + 20, stepMeta.getLocation().y + 20 );
        newStep.setDraw( true );

        transMeta.addStep( newStep );
        addUndoNew( transMeta, new StepMeta[] { newStep }, new int[] { transMeta.indexOfStep( newStep ) } );

        // Redraw stuff...
        refreshTree();
        refreshGraph();
      }
    } else {
      throw new KettleException( "There is no target to do a field mapping against!" );
    }
  } catch ( KettleException e ) {
    new ErrorDialog(
      shell, "Error creating mapping",
      "There was an error when Kettle tried to generate a field mapping against the target step", e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:67,代码来源:Spoon.java



注:本文中的org.pentaho.di.trans.steps.selectvalues.SelectValuesMeta类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ACompressionAlgorithm类代码示例发布时间:2022-05-23
下一篇:
Java EagerNClass类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap