1

I am trying to use type safe BigQuery classes. I have also installed intellij scio plugin. But i get the error,

Error:(37, 21) type arguments [RowElement] do not conform to method typedBigQuery's type parameter bounds [T <: com.spotify.scio.bigquery.types.BigQueryType.HasAnnotation] sc.typedBigQueryRowElement

Here is my scala code:

def main(args: Array[String]): Unit = {

  @BigQueryType.fromQuery("select id, org, env from TABLE") 
  class RowElement

  val (sc: ScioContext, arg) = ContextAndArgs(args)
  sc.typedBigQuery[RowElement]("select id, org, env from TABLE")
    .saveAsTypedBigQuery("TABLE_DEST")
  sc.close()
}
CertainPerformance
  • 356,069
  • 52
  • 309
  • 320
Akhilesh
  • 11
  • 2

1 Answers1

0

All @BigQueryType annotations should be in the top level of an object to avoid any macro expansion issues. For example:

object MyPipeline { @BigQueryType.fromQuery("...") class MyRecord }

Neville Li
  • 420
  • 3
  • 10