日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

通過MaxCompute查詢和分析OSS數(shù)據(jù)

部分應(yīng)用可能每天都有大量的數(shù)據(jù)上傳至OSS,這些數(shù)據(jù)可能涉及超大文本文件的結(jié)構(gòu)化分析。您可以通過MaxCompute的外部表查詢功能,將OSS存儲的數(shù)據(jù)加載到MaxCompute進(jìn)行分析。MaxCompute的數(shù)據(jù)查詢和分析工作效率可提升至分鐘級,幫助您更高效、更低成本地挖掘海量數(shù)據(jù)的價值。

前提條件

操作步驟

  1. 將物聯(lián)網(wǎng)采集的數(shù)據(jù)上傳到OSS。

    1. 準(zhǔn)備數(shù)據(jù)。

      本地創(chuàng)建vehicle.csv文件,文件包含的示例數(shù)據(jù)如下:

      1,1,51,1,46.81006,-92.08174,9/14/2014 0:00,S
      1,2,13,1,46.81006,-92.08174,9/14/2014 0:00,NE
      1,3,48,1,46.81006,-92.08174,9/14/2014 0:00,NE
      1,4,30,1,46.81006,-92.08174,9/14/2014 0:00,W
      1,5,47,1,46.81006,-92.08174,9/14/2014 0:00,S
      1,6,9,1,46.81006,-92.08174,9/14/2014 0:00,S
      1,7,53,1,46.81006,-92.08174,9/14/2014 0:00,N
      1,8,63,1,46.81006,-92.08174,9/14/2014 0:00,SW
      1,9,4,1,46.81006,-92.08174,9/14/2014 0:00,NE
      1,10,31,1,46.81006,-92.08174,9/14/2014 0:00,N
    2. vehicle.csv文件上傳至華東1(杭州)地域examplebucket的demo/目錄下。具體操作,請參見上傳文件

  2. 運行MaxCompute客戶端。

    具體操作,請參見運行MaxCompute客戶端

  3. 通過MaxCompute創(chuàng)建外部表。具體操作,請參見創(chuàng)建表

    創(chuàng)建非分區(qū)表data_csv_external,示例如下。

    CREATE EXTERNAL TABLE IF NOT EXISTS data_csv_external
    (
        vehicleId int,
        recordId int,
        patientId int,
        calls int,
        locationLatitute double,
        locationLongtitue double,
        recordTime string,
        direction string
        )
        STORED BY 'com.aliyun.odps.CsvStorageHandler'    
        LOCATION 'oss://oss-cn-hangzhou-internal.aliyuncs.com/examplebucket/demo/';
  4. 通過MaxCompute查詢外部表。

    執(zhí)行如下SQL語句:

    select recordId, patientId, direction from data_csv_external where patientId > 25;

    輸出結(jié)果如下:

    +------------+------------+-----------+
    | recordId   | patientId  | direction |
    +------------+------------+-----------+
    | 1          | 51         | S         |
    | 3          | 48         | NE        |
    | 4          | 30         | W         |
    | 5          | 47         | S         |
    | 7          | 53         | N         |
    | 8          | 63         | SW        |
    | 10         | 31         | N         |
    +------------+------------+-----------+

常見問題

報錯:Accessing project '<projectname>' failed: ODPS-0420095: Access Denied - Authorization Failed [4002], You don't exist in project <projectname>.如何解決?

相關(guān)文檔

  • MaxCompute支持您在項目中創(chuàng)建OSS外部表,與OSS上的目錄建立映射關(guān)系,您可以通過OSS外部表訪問OSS目錄下的非結(jié)構(gòu)化數(shù)據(jù),或者將MaxCompute項目中的數(shù)據(jù)寫入OSS。更多信息,請參見創(chuàng)建OSS外部表

  • 如果您需要將MaxCompute表中的數(shù)據(jù)導(dǎo)出到本地,便于離線查看數(shù)據(jù)。請參見運行SQL命令并導(dǎo)出結(jié)果數(shù)據(jù)

  • 如果您不再需要保留表數(shù)據(jù)或MaxCompute項目,可以刪除表或MaxCompute項目,以免產(chǎn)生不必要的資源浪費及賬單費用。請參見刪除表或MaxCompute項目