malloydata / malloy-composer

Malloy Composer is a simple application to build dashboards or run ad-hoc queries using an existing Malloy model
http://www.malloydata.dev
MIT License
52 stars 9 forks source link

Error occurs when adding fields with the same name #47

Open carlineng opened 1 year ago

carlineng commented 1 year ago

Using the Baby Names example, first add gender, then add cohort.gender: image

Composer crashes with the error Ambiguous output field name: image

christopherswenson commented 1 year ago

Great catch — thanks for filing the issue. The language doesn't allow for multiple fields with the same "output" name in a query (gender and cohort.gender both have the same output name), and gives that error "Ambiguous output field name." if you try.

Probably the UI should force you to rename one of them if you try to do this.

christopherswenson commented 1 year ago

Independent of the fix, we should probably catch errors that result from bad generated queries and handle them more gracefully...

whscullin commented 1 year ago

Splitting unhandled exception out to https://github.com/malloydata/malloy-composer/issues/54

tschomer commented 1 year ago

perhaps we could rename things, so this works without the user having to figure things out.