Google DataFusion中BigQuery Sink插件运行时参数schema配置报错
Google DataFusion BigQuery Sink:运行时参数'sqloutput_schema'未定义的解决办法
问题场景
我在Google DataFusion的BigQuery Sink插件中尝试通过运行时参数定义仅包含两列的BigQuery表结构,使用的argument setter.json配置如下:
{ "arguments" : [ {"name":"bq.config.table","value":"activity_category"}, { "name" : "sqloutput_schema", "type" : "schema", "value" : [ {"name":"activity_category_id","type":"string","nullable":true}, {"name":"activity_category_description","type":"string"} ] } ] }
运行时触发报错:
Spark program 'phase-2' failed with error: Argument 'sqloutput_schema' is not defined.Please check the system logs for more details. io.cdap.cdap.api.macro.InvalidMacroException: Argument 'sqloutput_schema' is not defined.
解决办法
修正参数命名
BigQuery Sink插件的运行时表结构参数标准名称为schema,而非sqloutput_schema。修改后的配置如下:{ "arguments" : [ {"name":"bq.config.table","value":"activity_category"}, { "name" : "schema", "type" : "schema", "value" : [ {"name":"activity_category_id","type":"string","nullable":true}, {"name":"activity_category_description","type":"string"} ] } ] }确认参数引用配置
在BigQuery Sink的可视化配置界面,需将表结构配置项设置为引用运行时参数${schema},而非填写固定schema内容。若未正确关联参数,插件运行时会无法识别定义的参数。验证插件版本兼容性
旧版本的BigQuery Sink插件可能不支持动态传入schema参数,建议升级至最新稳定版插件,同时确保DataFusion集群版本与插件版本匹配。检查参数类型适配
部分插件版本要求用record类型定义表结构,可尝试将参数的type字段改为record后重新测试。
内容的提问来源于stack exchange,提问作者RaptorX
相关产品推荐
相关产品推荐

