閱讀344 返回首頁    go 英雄聯盟


資源操作__常用命令_基本介紹_大數據計算服務-阿裏雲

命令格式:

  1. add file <local_file> [as alias] [comment 'cmt'][-f];
  2. add archive <local_file> [as alias] [comment 'cmt'][-f];
  3. add table <table_name> [partition <(spec)>] [as alias] [comment 'cmt'][-f];
  4. add jar <local_file.jar> [comment 'cmt'][-f];

說明:

  • file/archive/table/jar表明資源類型,資源類型的介紹請參考資源(Resource)
  • local_file:表示本地文件所在路徑。並以此文件名作為該資源名,資源名是資源的唯一標識。
  • table_name:表示MaxCompute 中的表名
  • [PARTITION (spec)]:當添加的資源為分區表時,MaxCompute 僅支持將某個分區作為資源,不支持將整張分區表作為資源;
  • alias:指定資源名,不加該參數時默認文件名為資源名。Jar及Py類型資源不支持此功能;
  • [comment ‘cmt’]:給資源添加注釋;
  • [-f]:當存在同名的資源時,此操作會覆蓋原有資源;若不指定此選項,存在同名資源時,操作將失敗。

示例:

  1. odps@ odps_public_dev>add table sale_detail partition (ds='20150602') as sale.res comment 'sale detail on 20150602' -f;
  2. OK: Resource 'sale.res' have been updated.
  3. ---添加一個別名為sale.res的表資源到MaxCompute

注解:目前,每個資源文件的大小不能超過64M,單個SQL, MapReduce任務所引用的資源總大小不能超過512M。

刪除資源

命令格式:

  1. DROP RESOURCE <resource_name>;

說明:

  • resource_name:創建資源時指定的資源名

查看資源列表

命令格式:

  1. LIST RESOURCES;

說明:查看當前項目空間下所有的資源。

示例:

  1. odps@ $project_name>list resources;
  2. Resource Name Comment Last Modified Time Type
  3. 1234.txt 2014-02-27 07:07:56 file
  4. mapred.jar 2014-02-27 07:07:57 jar

下載資源

命令格式:

  1. GET RESOURCE [<project name>:]<resource name> <path>;

說明:下載文件類型的資源到本地。 資源類型必須為:file,jar,archive,py, 不支持table類型。示例:

  1. odps@ $project_name>get resource odps-udf-examples.jar d:;
  2. OK

最後更新:2016-11-23 17:16:04

  上一篇:go 表操作__常用命令_基本介紹_大數據計算服務-阿裏雲
  下一篇:go 函數操作__常用命令_基本介紹_大數據計算服務-阿裏雲