...
App Level Substitution
One possibility is for substitution to be implemented at the app level. This would be ideal if we want to keep the concept of macros Hydrator-specific. If substitution were to occur at the app level, then the user would dictate which fields will be macro-substitutable through the plugin configuration UI. In order to allow non-string properties to be substitutable, the user must provide a default value along with the macro through the UI. For example, it a user enters the "port" property as: ${port}, the UI will provide a way for the user to enter a default port value. Creating a DB batch source would yield the following configuration JSON:
Code Block | ||
---|---|---|
| ||
"plugin": { "name": "Database", "type": "batchsource", "properties": { "user": "${username}", "password": "${secure(sql-password)}", "jdbcPluginName": "jdbc", ... "importQuery": "select * from ${table-name};" ... "macrosDefaultsmacroDefaults": { "user": "admin", "password": "pw1234", "importQuery": "DO 0" } } } |
Platform Level Substitution
Another possibility is for substitution to be implemented at the platform level. This would be ideal if we want to keep the concept of macros available across all CDAP applications.