Versions Compared

Key

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

...

Macros are variables wrapped inside of a ${ }. The placeholder you enter for the macro is called the key, which you’ll see when you set the macro’s value at runtime.

To separate the words of a placeholder or macro key, you can use dot notation, camel case, dashes, or underscores. It’s best practice to use the same notation for all macros so it’s easy to spot a macro at a glance.  

Info

Important: Macro keys must be unique across a CDAP instance.

A common use of macros is in Path fields. Instead of using hard coded paths, you can use dynamic paths. For example, in a GCS source plugin, you might replace the path using multiple macros to split the bucket, folder, and file portions as follows: gs://${bucket.name}/${folder}/${file.name}. Or, if you want to ingest data from a bucket that is static and a file with a name that isn’t static, enter the name of the bucket and use a macro for the file name. The Path field will look like this:  

...