{"action":"created","issue":{"url":"https://api.github.com/repos/spotify/scio/issues/24","repository_url":"https://api.github.com/repos/spotify/scio","labels_url":"https://api.github.com/repos/spotify/scio/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/spotify/scio/issues/24/comments","events_url":"https://api.github.com/repos/spotify/scio/issues/24/events","html_url":"https://github.com/spotify/scio/issues/24","id":138372100,"number":24,"title":"Macro generated BQ classes not working IntelliJ IDEA","user":{"login":"nevillelyh","id":468514,"avatar_url":"https://avatars.githubusercontent.com/u/468514?v=3","gravatar_id":"","url":"https://api.github.com/users/nevillelyh","html_url":"https://github.com/nevillelyh","followers_url":"https://api.github.com/users/nevillelyh/followers","following_url":"https://api.github.com/users/nevillelyh/following{/other_user}","gists_url":"https://api.github.com/users/nevillelyh/gists{/gist_id}","starred_url":"https://api.github.com/users/nevillelyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevillelyh/subscriptions","organizations_url":"https://api.github.com/users/nevillelyh/orgs","repos_url":"https://api.github.com/users/nevillelyh/repos","events_url":"https://api.github.com/users/nevillelyh/events{/privacy}","received_events_url":"https://api.github.com/users/nevillelyh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spotify/scio/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spotify/scio/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-04T04:06:40Z","updated_at":"2016-04-26T20:48:24Z","closed_at":null,"body":"Auto-completion and syntax highlighting doesn't work in IDEA.\r\nhttps://youtrack.jetbrains.com/oauth?state=%2Fissue%2FSCL-8834"},"comment":{"url":"https://api.github.com/repos/spotify/scio/issues/comments/214881265","html_url":"https://github.com/spotify/scio/issues/24#issuecomment-214881265","issue_url":"https://api.github.com/repos/spotify/scio/issues/24","id":214881265,"user":{"login":"nevillelyh","id":468514,"avatar_url":"https://avatars.githubusercontent.com/u/468514?v=3","gravatar_id":"","url":"https://api.github.com/users/nevillelyh","html_url":"https://github.com/nevillelyh","followers_url":"https://api.github.com/users/nevillelyh/followers","following_url":"https://api.github.com/users/nevillelyh/following{/other_user}","gists_url":"https://api.github.com/users/nevillelyh/gists{/gist_id}","starred_url":"https://api.github.com/users/nevillelyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevillelyh/subscriptions","organizations_url":"https://api.github.com/users/nevillelyh/orgs","repos_url":"https://api.github.com/users/nevillelyh/repos","events_url":"https://api.github.com/users/nevillelyh/events{/privacy}","received_events_url":"https://api.github.com/users/nevillelyh/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T20:48:24Z","updated_at":"2016-04-26T20:48:24Z","body":"Right now the closest workaround, with #111, would be:\r\n\r\nMake a query in the REPL, fetch result schema with `@BigQueryType.fromTable()`, and get case class definitions with `toPrettyString()`.\r\n\r\n```\r\nscala> val table = bq.query(\"SELECT repository.* FROM [bigquery-public-data:samples.github_nested] LIMIT 1000\")\r\n...\r\ntable: com.google.api.services.bigquery.model.TableReference = {datasetId=scio_bigquery_staging_us, projectId=gabocontinuousintegration, tableId=scio_query_20160426204308_37560664}\r\n\r\nscala> table.getProjectId + \":\" + table.getDatasetId + \".\" + table.getTableId\r\nres1: String = gabocontinuousintegration:scio_bigquery_staging_us.scio_query_20160426204308_37560664\r\n\r\nscala> @BigQueryType.fromTable(\"gabocontinuousintegration:scio_bigquery_staging_us.scio_query_20160426204308_37560664\") class Row\r\ndefined class Row\r\ndefined object Row\r\ndefined class Repository$\r\n\r\nscala> Row.toPrettyString()\r\nres2: String =\r\n@BigQueryType.toTable\r\ncase class Row(repository: Option[Repository$2])\r\ncase class Repository$2(url: Option[String], has_downloads: Option[Boolean], created_at: Option[String], has_issues: Option[Boolean], description: Option[String], forks: Option[Int], fork: Option[Boolean], has_wiki: Option[Boolean], homepage: Option[String], integrate_branch: Option[String], master_branch: Option[String], size: Option[Int], private: Option[Boolean], name: Option[String], organization: Option[String], owner: Option[String], open_issues: Option[Int], watchers: Option[Int], pushed_at: Option[String], language: Option[String])\r\n```\r\n\r\nAnd then copy these case class definitions to the job code and use `sc.typedBigQuery[Row](query)`."}}