Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: Problem while using sql alias names when I run transform from java

  1. #1
    Join Date
    Nov 2007
    Posts
    3

    Default Problem while using sql alias names when I run transform from java

    Hi,

    I am using Kettle version 3.0.4.

    My InputStep has a query as
    SELECT column1 as column1Alias, b as b1 from tableName

    In the steps following the inputStep I want to use alias name column1Alias for column column1.

    When I run the transforms as part of a job defination using a bat file (run this java file org.pentaho.di.kitchen.Kitchen), I am able to use the alias name in the following steps of InputStep and every thing works fine.

    Now I am not creating a Job. I create a transform and I am running my transfrom from with in java using the code.
    StepLoader.init();
    JobEntryLoader.init();
    EnvUtil.environmentInit();
    TransMeta transMeta =
    new TransMeta(transformationToRun);
    Trans trans =
    new Trans(transMeta);
    logger.info("Running Transformation : " + transformationToRun);
    trans.execute(
    null); // You can pass arguments instead of null.

    trans.waitUntilFinished();
    if ( trans.getErrors() > 0 )
    {
    logger.error("Transformation execution FAILED : " + transformationToRun);
    thrownew RuntimeException( "There were errors during transformation execution." );

    }

    Kettle complains that It is not able to find field by the alias name in the following steps of InputStep.

    If I do not use the alias name in the following steps everything works fine.

    Is this a bug or I am missing something?

    Attached the transformation.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.