After you create a MaxCompute table, you can write data to the table for data analysis. You can also import data from a workbook, local CSV file, or local Excel file to the table.

Prerequisites

A MaxCompute table is created. For more information, see Create and manage a MaxCompute table.

Procedure

  1. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region where the target workspace resides. Find the target workspace and click Data Analytics in the Actions column.
  2. On the DataStudio page, click the Icon icon in the upper-left corner and choose All Products > Data Development > DataAnalysis.
  3. On the DataAnalysis homepage, click Experience Now. The Web Excel page appears.
  4. In the top navigation bar, click Dimension.
  5. In the All Dimension Tables section of the Dimension page, click the name of the MaxCompute table that you want to edit in the File Name column to go to the MaxCompute table editing page.
    If you create a MaxCompute table in this step, the MaxCompute table editing page appears after the MaxCompute table is created. For more information, see Edit a MaxCompute table.
  6. On the MaxCompute table editing page, click Import in the upper-right corner.
  7. In the Import dialog box, select the type of the file to be imported and set the parameters.
    Note Only data of the STRING type can be imported to a MaxCompute table. Data that is not of the STRING type will be converted to the STRING type automatically when it is imported.
    Import
    • WorkbookWorkbook
      Parameter Description
      Spreadsheet The workbook from which the data is to be imported. Select a workbook from the Spreadsheet drop-down list.
      Sheet The sheet from which the data is to be imported. Select a sheet from the Sheet drop-down list.
      Data Preview A section that displays the data in the selected sheet. When you preview the data in the selected sheet, you can determine whether to use the values in the first row as the column names by selecting or clearing First Row as Field Names.
      Field Mapping The mappings between the columns in the selected sheet and the fields in the MaxCompute table.
      Import Data Mode The mode used to import data. Valid values: Append and Overlay.
    • Local CSV fileLocal CSV file
      Parameter Description
      File The local CSV file from which the data is to be imported. Click Select File(.csv), select a local CSV file, and then click Open.
      Original Character Set The character set that is used by the selected CSV file. Valid values: UTF-8 and GBK. If garbled characters appear, you can change the character set.
      Separator The row separator and column separator.
      • Valid values of row separators: \r\n, \n, and \r.
      • Valid values of column separators: ,, ;, and \t.

      If the cell data cannot be correctly divided, you can change the separators.

      Data Preview A section that displays the data in the selected CSV file. When you preview the data in the selected CSV file, you can determine whether to use the values in the first row as the column names by selecting or clearing First Row as Field Names.
      Field Mapping The mappings between the columns in the selected CSV file and the fields in the MaxCompute table.
      Import Data Mode The mode used to import data. Valid values: Append and Overlay.
    • Local Excel fileExcel
      Parameter Description
      File The local Excel file from which the data is to be imported. Click Select File(.xlsx), select a local Excel file, and then click Open.
      Sheet The sheet from which the data is to be imported. Select a sheet from the Sheet drop-down list.
      Data Preview A section that displays the data in the selected sheet. When you preview the data in the selected sheet, you can determine whether to use the values in the first row as the column names by selecting or clearing First Row as Field Names.
      Field Mapping The mappings between the columns in the selected sheet and the fields in the MaxCompute table.
      Import Data Mode The mode used to import data. Valid values: Append and Overlay.
  8. Click OK.
  9. Click Save in the upper-right corner of the page.
    After you save the MaxCompute table, you can use the Diff feature to check whether the changes are as expected to avoid misoperations.