赞
踩
Please set odps.sql.type.system.odps2=true to use it.
或提示Please add put { "odps.sql.submit.mode" : "script"} for multi-statement query in settings
的解决方案AnonymousSQLTask--ODPS-0130071:[1,474] Semantic analysis exception - DATE type is not enabled in current mode.
Please set odps.sql.type.system.odps2=true to use it.
ODPS-0130071:[1,1165] Semantic analysis exception - DATE type is not enabled in current mode.
Please set odps.sql.type.system.odps2=true to use it.
// 或提示下面的错误信息
com.aliyun.odps.OdpsException:
Please add put { "odps.sql.submit.mode" : "script"} for multi-statement query in settings
在执行task前,将上面的配置信息增加进hints中
public Instance sqlRunTable(String sql) throws OdpsException { Map<String, String> hints = new HashMap<>(); hints.put("odps.sql.submit.mode", "script"); hints.put("odps.sql.type.system.odps2", "true"); SQLTask.setDefaultHints(hints); Instance instance = SQLTask.run(odps, sql); if (!instance.isSync()) { instance.waitForSuccess(); } if (!instance.isSuccessful()) { log.error("ODPS执行SQL语句失败!{}", sql); for (String key : instance.getTaskResults().keySet()) { log.error("{}--{}", key, instance.getTaskResults().get(key)); } } return instance; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。