Skip to Content
May 09, 2018 at 10:03 AM

Source File name passing to Traget field name

80 Views Last edit May 09, 2018 at 10:07 AM 3 rev

Hi Experts ,

I am having one requirement to read the source filename and pass this value to Target field name.

I used Dynamic configuration UDF :

  String FileValue = "";
    //Get the DynamicConfiguration instance
    DynamicConfiguration config = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //Define key to read from the Dynamic Configuration
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("", "FileName");
    //Read the FileName parameter from the Dynamic Configuration based on the key
  String filename = conf.get(key);
  }catch(Exception ee)
    FileValue = "";
  return FileValue;

I am getting an error like while activating mapping :

String filename = conf.get(key) is not valid .

Can anyone suggest, how to fix this.

Best , Shiva