Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not extract nested var on athena.add_partition>: at partition keys #84

Open
h-imaoka opened this issue Jul 22, 2020 · 1 comment
Open

Comments

@h-imaoka
Copy link

h-imaoka commented Jul 22, 2020

Hi, I use athena.add_partition>: to make partition in hourly. So calc current date & hour from session_time by digdag's feature.I guess other ops such as ctas , query ,,, supports nested variables, but add_partition (and maybe drop_partiton) doesn't work well.

In the my example.dig, thrown exception about s3 path, but in our production environment, the partition was created with the value that ${moment(session_time...} was not expanded.

AWS_Glue_Console

example.dig
If you set ${ny_dt} insted of ${curr_dt} at partition_kv: work normaly.

_export:
  plugin:
    repositories:
      - file://${repos}
      # - https://jitpack.io
    dependencies:
      - pro.civitaspo:digdag-operator-athena:0.4.0
  athena:
    auth_method: profile
  curr_dt: ${moment(session_time).format("YYYY-MM-DD")}
  ny_dt: 2020-01-01

+step7:
  athena.ctas>: select 1 as a, 2 as b, '${ny_dt}' as dt union all select 4 as a, 5 as b, '${curr_dt}' as dt
  database: ${database}
  table: hoge
  location: ${output}
  partitioned_by: [dt]

# +step8:
#   athena.drop_partition>:
#   database: ${database}
#   table: hoge
#   partition_kv:
#     dt: "${curr_dt}"

+step9:
  athena.add_partition>:
  database: ${database}
  table: hoge
  partition_kv:
    dt: "${curr_dt}"

error

  * +example+step9:
    Illegal character in path at index 37: s3://imaoka-oregon-athena/digdag/dt=${moment(session_time).format("YYYY-MM-DD")}/ (illegal argument)
@civitaspo
Copy link
Owner

civitaspo commented Aug 5, 2020

This issue will be resolved when treasure-data/digdag#862 is resolved.

ref. treasure-data/digdag#1077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants