{"action":"opened","issue":{"url":"https://api.github.com/repos/korma/Korma/issues/356","repository_url":"https://api.github.com/repos/korma/Korma","labels_url":"https://api.github.com/repos/korma/Korma/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/korma/Korma/issues/356/comments","events_url":"https://api.github.com/repos/korma/Korma/issues/356/events","html_url":"https://github.com/korma/Korma/issues/356","id":154652864,"number":356,"title":"Optionally parenthesize multiple JOIN expressions","user":{"login":"hden","id":1910549,"avatar_url":"https://avatars.githubusercontent.com/u/1910549?v=3","gravatar_id":"","url":"https://api.github.com/users/hden","html_url":"https://github.com/hden","followers_url":"https://api.github.com/users/hden/followers","following_url":"https://api.github.com/users/hden/following{/other_user}","gists_url":"https://api.github.com/users/hden/gists{/gist_id}","starred_url":"https://api.github.com/users/hden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hden/subscriptions","organizations_url":"https://api.github.com/users/hden/orgs","repos_url":"https://api.github.com/users/hden/repos","events_url":"https://api.github.com/users/hden/events{/privacy}","received_events_url":"https://api.github.com/users/hden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-13T07:47:46Z","updated_at":"2016-05-13T07:47:46Z","closed_at":null,"body":"`[korma \"0.4.2\"]`\r\n\r\nContinued from #58 \r\n\r\nGoogle BigQuery fails when multiple JOIN expression are parenthesized. This can be easily reproduced by the following queries:\r\n\r\n```clojure\r\n#  KORMA FORM\r\n{:where [{:pred korma.sql.engine$do_group, :args [\" AND \" ({:pred korma.sql.engine$do_infix, :args [{:generated \"[doh].[members].[c\r\nountry]\"} \"=\" {:generated \"'tw'\"}]})]}],\r\n :group [{:generated \"[doh.restaurants.country]\"}],\r\n :table {:generated \"[doh.bookings]\"},\r\n :fields [[{:func \"COUNT(%s)\", :args ({:generated \"*\"})} :count]\r\n            [:doh.restaurants.country \"doh.restaurants.country\"]],\r\n :joins\r\n [[:left \"doh.members\" {:pred korma.sql.engine$do_infix, :args [:doh.bookings.member_id \"=\" :doh.members.id]}]\r\n  [:left \"doh.restaurants\" {:pred korma.sql.engine$do_infix, :args [:doh.bookings.restaurant_id \"=\" :doh.restaurants.id]}]],\r\n :order [[{:generated \"[doh.restaurants.country]\"} :ASC]]}\r\n```\r\n\r\n```SQL\r\n-- SQL\r\nSELECT COUNT(*) AS [count], [doh.restaurants.country] AS [doh.restaurants.country]\r\nFROM ([doh.bookings]\r\nLEFT JOIN [doh.members] ON [doh.bookings.member_id] = [doh.members.id])\r\nLEFT JOIN [doh.restaurants] ON [doh.bookings.restaurant_id] = [doh.restaurants.id]\r\nWHERE ([doh.members.country] = 'tw')\r\nGROUP BY [doh.restaurants.country]\r\nORDER BY [doh.restaurants.country] ASC\r\n```\r\n\r\nError Message:\r\n```\r\nQuery Failed\r\nError: Encountered \"\" at line 2, column 7.\r\n```"}}