linkedin / linkedin-gradle-plugin-for-apache-hadoop

Apache License 2.0
117 stars 76 forks source link

Fix variable substitution issue for dependency list. #229

Closed jamiesjc closed 6 years ago

jamiesjc commented 6 years ago

Similar to the issue in #228 , it will cause an incompatible issue when defining depends or targets as a list which contains ${} when generating YAML files. For example, in workflow.gradle:

def jobName = "job1"
def targetList = ["${jobName}"]
hadoop {
  workflow('wordCountFlow') {
    hadoopShellJob("${jobName}") {
      uses "bash ./test.sh"
    }
    targets targetList
  }
}

This would throw below error:

- name: wordCountFlow
  type: noop
  dependsOn:
  - !!org.codehaus.groovy.runtime.GStringImpl
    metaClass: &id001 !!groovy.lang.MetaClassImpl {}

We should also explicitly do the toString()conversion for the dependency list.

jamiesjc commented 6 years ago

I've released the MP locally and verified the fix with the user.