Using an Advanced Transformer Spark Job

  1. Create an instance of DataNormalizationFactory, using its static method getInstance().
  2. Provide the input and output details for the Advanced Transformer job by creating an instance of AdvancedTransformerDetail specifying the ProcessType. The instance must use the type SparkProcessType.
    1. Configure the advanced transformer rules by creating an instance of AdvancedTransformerConfiguration.
      Within this instance, add an instance of type AbstractAdvancedTransformerRules. This AbstractAdvancedTransformerRules instance must be defined using one of these classes: TableDataExtraction or RegularExpressionExtraction, corresponding to the desired advanced transformer rule category.
    2. Set the details of the Reference Data path and location type by creating an instance of ReferenceDataPath. See Enum ReferenceDataPathLocation.
    3. Create an instance of AdvancedTransformerDetail, by passing an instance of type JobConfig, and the AdvancedTransformerConfiguration and ReferenceDataPath instances created earlier as the arguments to its constructor.
      The JobConfig parameter must be an instance of type SparkJobConfig.
    4. Set the details of the input file using the inputPath field of the AdvancedTransformerDetail instance.
      • For a text input file, create an instance of FilePath with the relevant details of the input file by invoking the appropriate constructor.
      • For an ORC input file, create an instance of OrcFilePath with the path of the ORC input file as the argument.
      • For a Parquet input file, create an instance of ParquetFilePath with the path of the Parquet input file as the argument.
    5. Set the details of the output file using the outputPath field of the AdvancedTransformerDetail instance.
      • For a text output file, create an instance of FilePath with the relevant details of the output file by invoking the appropriate constructor.
      • For an ORC output file, create an instance of OrcFilePath with the path of the ORC output file as the argument.
      • For a Parquet output file, create an instance of ParquetFilePath with the path of the Parquet output file as the argument.
    6. Set the name of the job using the jobName field of the AdvancedTransformerDetail instance.
  3. To create and run the Spark job, use the previously created instance of DataNormalizationFactory to invoke its method runSparkJob(). In this, pass the above instance of AdvancedTransformerDetail as an argument.
    The runSparkJob() method runs the job and returns a Map of the reporting counters of the job.
  4. Display the counters to view the reporting statistics for the job.