本文是基於本人對MaxCompute產品的學習進度,再結合開發者社區釘群裡的一些問題,進而整理成文。希望對大家有所幫助。
問題一、一般都是子賬號登錄使用MaxCompute,是否有工具可以查到用戶行為,如對錶的增、刪、改、查等操作?
可以通過審計日誌功能和元數據功能配合使用,查到用戶行為記錄。可以參考下面這篇文章:
https://developer.aliyun.com/article/771413
問題二、odpscmd可以通過什麼命令導出數據?
可以使用Tunnel download。可以參考下面這篇文檔:
https://help.aliyun.com/document_detail/143537.html
問題三、請問MaxCompute 的DataFrame拿到某一列的值轉換成list應該如何操作?
print iris['sepallength'].tolist().execute()[0:5]
問題四、pyodps如何獲取表的元數據?
直接查詢Information_Schema表就可以。可以參考元數據使用說明文檔:
https://help.aliyun.com/document_detail/135432.html
問題五、MaxCompute是否有函數能把日期轉換成周幾?
可以使用WEEKDAY內建函數。可以參考官方文檔:
https://help.aliyun.com/document_detail/48974.html
問題六、創建外部表報錯,<Code>AccessDenied</Code> <Message>The bucket you access does not belong to you.</Message>
需要授權,參考一下官方文檔:
https://help.aliyun.com/document_detail/72777.html
問題七、MaxCompute 有無一些類似數據庫的內置函數,可以將3條記錄變成1條,之後逗號隔開。
可以使用WM_CONCAT內建函數。可以參考官方文檔:
https://help.aliyun.com/document_detail/48975.html
問題八、在odps sql計算比例時,分母為0時怎麼處理,有相應的函數嗎?
可以使用DECODE內建函數。可以參考官方文檔:
https://help.aliyun.com/document_detail/48976.html
問題九、MaxCompute SQL報錯Invalid arguments - format string has second part, but doesn't have minute part : yyyy-mm-dd hh:mm:ss
可以做一下類型轉換to_date('20181030 15-13-12.345','yyyymmdd hh-mi-ss.ff3')=2018-10-30 15:13:12
問題十、MaxCompute SQL 去重ID怎麼做?
可以使用group或者distinct去重。
問題十一、MaxCompute刪除表數據如何恢復?
可以使用備份與恢復功能。可以參考官網文檔:
https://help.aliyun.com/document_detail/172397.html
問題十二、MaxCompute查詢加速MCQA只能支持標準模式嗎?
可以支持簡單模式哈。MCQA功能不支持包年包月計費模式。可以參考官網文檔:
https://help.aliyun.com/document_detail/180701.html
問題十三、MaxCompute中string 轉array 有啥好的方法沒? 類似這樣select cast('["a","b","c"]' as array);
直接用split切分就行。
問題十四、MaxCompute可以對單個表授權嗎?
可以使用ACL授權,參考官網文檔:
https://help.aliyun.com/document_detail/27935.html
問題十五、如何評估MaxCompute存儲資源和計算資源?
可以參考一下這篇文章:https://developer.aliyun.com/article/771967