aliyun / aliyun-odps-python-sdk

ODPS Python SDK and data analysis framework
http://pyodps.readthedocs.io
Apache License 2.0
434 stars 97 forks source link

在 linux 環境下 使用 Pyodps 遇到 Semantic analysis exception #76

Closed brian1125 closed 6 years ago

brian1125 commented 6 years ago

Table Schema 中有 INT type 的欄位,使用 pyodps 建立 partition 或者 刪除 partition 都會出現以下訊息

odps.errors.ODPSError: InstanceId: 20180724090800847g3ztupsa
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode
ODPS-0130071:[0,0] Semantic analysis exception - INT type is not enabled in current mode

透過 odpscmd 輸入 相對應的 sql 也會出現 查了文件知道 是 odps2 支援類型的關係 執行sql 語句 之前 要添加 set odps.sql.type.system.odps2=true 才能運行

如果只使用 pyodps 該如何避免類似的錯誤?

wjsi commented 6 years ago

参考 options.sql.use_odps2_extension (http://pyodps.readthedocs.io/zh_CN/latest/options.html)