MaxCompute Studio的Project Explorer提供了可視化編輯器,可以協助您快速在MaxCompute專案中添加註冊MaxCompute UDF所需的資源,例如表、JAR包、PY指令碼或壓縮包等,並提供擷取及刪除資源的入口。本文為您介紹如何通過Project Explorer可視化添加、擷取或刪除資源。
背景資訊
添加資源
在IntelliJ IDEA介面的頂部功能表列,選擇。
在Add Resource對話方塊配置下表所列參數資訊。
添加非Table資源在 Add Resource 對話方塊中,選擇 MaxCompute project,將 Resource type 設定為 file,單擊 Resource file 右側瀏覽按鈕選擇檔案,填寫 Resource name 和 Resource comment,勾選 Force update if already exists,單擊 OK。
添加Table資源在 Add Resource 對話方塊中,設定 MaxCompute project(選擇目標專案)、Resource type(選擇 table)、MaxCompute table(選擇目標表)、Table partition(按需填寫分區資訊)、Resource name(填寫資源名稱)和 Resource comment(可選備忘)。如需覆蓋同名資源,勾選 Force update if already exists,然後單擊 OK。
參數
說明
MaxCompute project
待添加資源的MaxCompute專案名稱。
如果MaxCompute Studio已與目標MaxCompute專案建立串連,您可以直接從下拉式清單選擇目標MaxCompute專案。如果下拉式清單未找到目標MaxCompute專案,您可以單擊右側
表徵圖添加MaxCompute專案。Resource type
資源類型。取值範圍如下:
file:File類型資源。支援的格式包括.zip、.so和.jar。
jar:編譯好的Java JAR包資源。
py:Python指令碼資源。
archive:壓縮包資源,支援的格式包括.zip、.tgz、.tar.gz、.tar和.jar。
table:表資源。您可以將MaxCompute專案中的表添加為資源。
Resource file
待添加的本地資源檔。僅當Resource type為file、jar、py或archive時,需要從本地選擇資源檔。
MaxCompute table
待添加為資源的表。您可以在下拉式清單選擇目標表。當添加的資源為分區表時,MaxCompute僅支援將某個分區作為資源,不支援將整張分區表作為資源。
Table partition
待添加為資源的分區資訊。僅當MaxCompute table為分區表時,需要配置該參數。格式為
partition_col1 = partition_col_value1, partition_col2 = partition_col_value2, ...。Resource name
新添加資源的名稱。
Resource comment
新添加資源的注釋資訊。
Force update if already exists
選中該項,表示當MaxCompute專案中存在同名資源時,新資源會替代舊資源。
在Add Resource對話方塊,單擊OK,完成資源添加。
按右鍵目標MaxCompute專案下的Resources,選擇Refresh meta更新資訊後,在列表中可以查看到新添加的資源。
擷取資源檔
在IntelliJ IDEA介面的左側導覽列,單擊Project Explorer,在目標MaxCompute專案的Resources下,按右鍵需要擷取資源檔的資源名稱,選擇Copy local meta path,即可複製資源檔所在路徑並在路徑下擷取到資源檔。
不支援擷取表資源檔。
刪除資源
在IntelliJ IDEA介面的左側導覽列,單擊Project Explorer,在目標MaxCompute專案的Resources下,按右鍵需要刪除的資源,選擇Delete resource from server。
在Confirmation Required對話方塊,單擊OK,即可從MaxCompute專案中刪除資源。
按右鍵目標MaxCompute專案下的Resources,選擇Refresh meta更新資訊後,列表中將無法查看到刪除的資源。