I'm attempting to do an operation wherein I get a list of Ids via a query, transform them into a string separated by commas (i.e. "1,2,3") and then use it in a secondary query. When attempting to run the second query, I'm given a syntax error:
"Target type of a lambda conversion must be an interface"
String query = "SELECT DISTINCT campaignId FROM `" + options.getEligibilityInputTable() + "` ";
Pipeline p = Pipeline.create(options);
p.apply("GetCampaignIds", BigQueryIO.readTableRows().withTemplateCompatibility().fromQuery(query).usingStandardSql())
.apply("TransformCampaignIds",
MapElements.into(TypeDescriptors.strings())
.via((TableRow row) -> (String)row.get("campaignId")))
.apply(Combine.globally(new StringToCsvCombineFn()))
.apply("GetAllCampaigns", campaignIds -> BigQueryIO.readTableRows().withTemplateCompatibility().fromQuery("SELECT id AS campaignId, dataQuery FROM `{projectid}.mysql_standard.campaigns` WHERE campaignId IN (" + campaignIds + ")").usingStandardSql())
....
How can I chain queries together?