Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. endStages(Optional): List of stages(inclusive) till which preview need to be executed. If not given, preview will be executed till the sink.
  2. realLookups: List of datasets to be used from the real space for the lookup purpose only. This is required field, since if it is not given the datasets from the preview space will be used which will be empty.
  3. realExternalWrites(Optional): List of EXTERNAL datasets to which the actual writes need to happen. If user does not want to write to the external dataset, we can replace the sink with the /dev/null sink in the pipeline configurations. Note that this is only required for the external datasets. The CDAP internal datasets will be created in the preview space only, so even if we write to them, those writes will not be visible in the real space.
  4. numRecords(Optional): Number of records to be read from the source for the preview. If not given we will read ALL the records pre-configured number of records(say 100) from the source.
  5. outputs(Optional): User can provide test data to preview using outputs configurations.

...

  1. Preview entire pipeline. Read from File source and write to the database.

    Code Block
    languagejava
    a. 
    "appPreviewConfig": {
       "realLookups": ["File"],
       "realExternalWrites": ["DBSink"]
    }
     
    b. Same can be achieved by
    "appPreviewConfig": {
       "endStages": ["DBSink"],
       "realLookups": ["FTP"],
       "realExternalWrites": ["DBSink"]
    }
  2. Preview pipeline with test records (in JSON format) instead of reading it from File.

    Code Block
    languagejava
    "appPreviewConfig": {
       "endStages": ["DBSink"],
       "realLookups": ["File"],
       "realExternalWrites": ["DBSink"],
       "outputs": {
          "File": {
             "data": {[
                {"offset": 1, "body": "100,bob"},
                {"offset": 2, "body": "200,rob"},
                {"offset": 3, "body": "300,tom"}
             }]
          }
       }
    }
     
    Above pipeline uses test records provided in the outputs section instead of reading from the actual Files.
  3. Preview pipeline without writing to the Database.

    Code Block
    languagejava
    "appPreviewConfig": {
       "endStages": ["DBSink"],
       "realLookups": ["File"],
       "outputs": {
          "File": {
             "data": {[
                {"offset": 1, "body": "100,bob"},
                {"offset": 2, "body": "200,rob"},
                {"offset": 3, "body": "300,tom"}
             }]
          }
       }
    }
     
    Since the realExternalWrites is not provided, app will be reconfigured to write to /dev/null
  4. Preview single stage CSVParser

    Code Block
    languagejava
    "appPreviewConfig": {
       "endStages": ["CSVParser"], // Note that endStages is updated to CSVParser to just preview the single stage.
       "realLookups": ["File"],
       "outputs": {
          "File": {
             "data": [
                {"offset": 1, "body": "100,bob"},
                {"offset": 2, "body": "200,rob"},
                {"offset": 3, "body": "300,tom"}
             ]
          }
       }
    }

...