Closed yokatsuki closed 8 years ago
@yokatsuki
Please try the following dig file.
_export:
tables: [table_a, table_b, table_c]
+repeat:
loop>: ${tables.length}
_do:
+guess:
sh>: env table_name=${tables[i]} embulk guess hoge/seed.yml.liquid -o ${tables[i]}.yml
hoge/seed.yml.liquid
in:
type: file
path_prefix: "/private/tmp/xxx/hoge/csv/sample_"
out:
type: {{ env.table_name }} # this is just test
Digdag export environment variable as tables="[table_a, table_b, table_c]"
.
So you can't extract environment variable {{env.tables[i]}}
part in Embulk config file.
You can check export variables like the following.
_export:
tables: [table_a, table_b, table_c]
+repeat:
loop>: ${tables.length}
_do:
+guess:
sh>: env
digdag run test --rerun
An example output is the following.
project_id=1
...
tables=["table_a","table_b","table_c"]
So I define environment variable table_name=XXX
before embulk guess
Thank you for quick answer. Set in accordance with your instructions, three of the config file has been created. And it had been in each of the file contains the result of estimating the table definition. Issue will close since the fully resolved. Thanks again.
Hello, I am trying to set the guess processing into multiple tables in digdag.
It has been able to include the value of the array to the name of the config file. However, it will not be able to read the value of the array in the guess file.
How can the description in the guess file, or you will be able to see an array of in the dig file?