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()
}
All
@BigQueryType
annotations should be in the top level of anobject
to avoid any macro expansion issues. For example:object MyPipeline { @BigQueryType.fromQuery("...") class MyRecord }