Loading Data from Cloud Storage

You can load data from a cloud store to a table in your Autonomous AI Database.

You can load files in these file formats: AVRO, CSV, JSON, GeoJSON, ORC, Delimited TXT, XLSX, PRQ, GZ, GNU ZIP, Tab-Separated Values and Oracle Business Intelligence Cloud Connector (BICC) extracts. The main output of a BICC extract is one or more CSV files that contain the extracted business data in a tabular format. Alongside the CSV files, there may be metadata or manifest files used internally by BICC or downstream processes to track the extract details, but the primary deliverables are the CSV data files. For information on supported file formats, see Format Specifications for JSON, AVRO, and XML Files. The Data Load tool supports loading tables from multiple worksheets XLSX files when the file is in a cloud store.

You can set filters on the data for a table to load only the specified data. For example, to limit the files to only those that are CSV files, enter *.CSV in the file extension filter.

Configure and run a data load job from the Load Cloud Object page. To open that page:

  1. Open the Database Actions and select Data Load.

  2. Select LOAD DATA and Cloud Store .

On the left side of the page is a navigator pane, where you choose a cloud store connection and the folders or files containing the data. On the right of the page is the data load cart, where you stage the files and folders for the data load job. You can set options for the data load job before running it. The Autonomous AI Database comes with predefined CPU/IO shares assigned to different consumer groups. You can set the consumer group to either low, medium or high while executing a data load job depending on your workload.

To load files from a cloud store into your database, do the following:

Manage Cloud Storage Links for Data Load Jobs

Before you can load data from a cloud store, you must establish a connection to the cloud store you want to use. You can select cloud store location from the cloud store locations field.

On the Load Data page when you select Cloud Store:

To return to the Load Cloud Object page, click Data Load in the breadcrumbs at the top of the page and then navigate back to the page.

Prepare the Data Load Job

As you’ll see below in Enter Details for the Data Load Job, the first decision you’ll make when configuring a data load job is how to load the source data into a new or existing table in the database. The choices are:

You may have to adjust your source data or your target table so that the source data loads correctly into the external target table. The number, order, and data types of columns in the source must match those in the target. Consider:

Add Files or Folders for the Data Load Job

Add files from the cloud store to the data load cart, where you can edit the details of the data load job. To add the files:

  1. From the list at the top of the navigator pane on the left, select the bucket from the drop-down with your source data.

    The list shows links that were established on the Manage Cloud Storage page. If you haven’t yet registered the cloud store you want to use, click the Create Cloud Store Location button at the top of the page and register a connection. See Manage Cloud Storage Links for Data Load Jobs, above.

  2. Drag one or more items from the file navigator on the left and drop them into the cart on the right.

    • You can add files, folders, or both. A card is added to the cart for each file or folder you drag into it. The card lists the name of the source file or folder and a proposed name for the target table.

    • If you add a folder that contains multiple files, all the files must be of the same type, that is, CSV, TXT, etc.

      When you add the folder to the cart, a prompt is displayed that asks if you want to load all the objects from the multiple source files into a single target table. Click Yes to continue or No to cancel.

    • When you add multiple individual files or multiple folders to the cart, the data represented by each card will be loaded into a separate table, but all the items in the cart will be processed as part of the same data load job. The multiple files you load must have same file extension.

    • You can add files or folders from a different bucket, but if you do that, you’re prompted to remove all files that are already in the cart before proceeding. To select files from a different bucket, select the bucket from the drop-down list in the navigator pane on the left and then add the file(s), as described above.

    • You can drop files or folders into the data load cart and then navigate away from the Data Load Object page. When you return to the page, those items remain on the page.

You can remove items from the cart before running the data load job:

Enter Details for the Data Load Job

Enter the details about the data load job in the Load Data from Cloud Storage pane.

On the card in the data link cart, click the Actions icon and select the Settings to open the Load Data from Cloud Storage pane for that job. The pane contains:

Settings Tab - Table Section

Set details about the target table in the Table section.

Settings Tab - Properties Section

Specify options to control how the source data is interpreted, previewed, and processed. These options vary, depending on the type of source data.

Settings Template

The save settings feature saves the configuration set in the Cart settings in the form of a JSON file. When opening the Settings template, you have the following options:

  1. Load Settings Template: Loads a settings template from your local system.

  2. Save Settings Template: Saves the current existing settings template.

    Description of the illustration settings-template.png

You can use the Load Settings Template if you want to use an existing customized template present in your local.

  1. From the Settings Template in the Settings tab of the Load Data page, select Load Settings Template.

  2. You will see a Load Settings Template wizard, click the Settings Template JSON to load a JSON file from your system.

  3. Clicking the Settings template JSON will open your local system. Click OK to load the JSON file.

  4. After you load the JSON file, you can view the updates applied automatically to the settings tab which matches the JSON settings template you load from your local.

You can use the Save Settings Template to save the existing current Settings template.

  1. From the Settings Template in the Settings tab of the Load Data page, select Save Settings Template.

  2. The Template file editor appears. Click the Template File name and name the new template.

  3. Click OK to finish saving the new name of the existing template.

  4. You can test the configuration of the new template.

Bulk Edit Settings

You can use the Bulk edit settings to update all the columns at once from the mapping table. Use it to apply changes to the selection currently displayed in the results pane. You can search for the values of the column you want to edit in the search field and click the magnifier icon. The mapping table will display the results of the search. Select the Bulk Edit setting to update the column. The Bulk Edit setting allows you to:

Searching the Column

The Bulk Edit setting updates the columns returned by the search field. The search box below the Available Columns on the Bulk Edit Mapping wizard filters the list of columns you wish to update in a bulk. You can also click the column you wish to select from the list of Available Columns. Choose any of the available options:

The Bulk Edit Mapping enables you to update the values of the following columns for all the searches returned by the search field:

Consider changing the Data Type of first five rows from VARCHAR2 to CHAR in the mapping table.

Description of the illustration bulk-edit1.png

Settings Tab - Mapping Section

The settings in the Mapping section control how data from the source files are loaded into the rows of the target database table. For each row, the data from the column listed under Source column will be loaded into the column listed under Target column.

As mentioned above, the contents of the Mapping table change according to what processing option you chose in the Table section and which properties you set in the Properties section.

You can filter the results in the mapping table with Quick Filter field that enables you to filter out Columns or Expressions.

Select Add Expression to perform Sentiment Analysis or Key Phrase extraction with the source data. See Use OCI Language Service Capabilities in Data Studio for more details.

Preview Tab

The Preview tab displays the source data in tabular form in the Load Preview menu. The display reflects the settings you chose in the Properties section.

The File menu in the Preview tab displays the source data with all the columns with their names. You can copy the text.

Table Tab

The Table tab displays what the target table is expected to look like after the data has been loaded. If you chose the Create Table processing option, no table is shown.

SQL Tab

The SQL tab displays the SQL commands that will be run to complete this data load job.

Note: You can see the SQL code even before the table is created.

Close Button - Save and Close the Pane

After entering all the details for the data load job, click Close at the bottom of the page. This saves the details you entered and returns you to the Load Data from Cloud Storage pane. To close the page without saving your entries, press Escape.

Run the Data Load Job

Once you’ve added data sources to the data load cart and entered details about the data load job, you can run the job.

To run the job:

  1. If you haven’t already done so, click the Close button in the Load Data from Cloud Storage pane to save your settings and close the pane. If any of the settings are invalid, an error message reports the problem. Fix the problem and click Close.

  2. Click Start in the data load cart menu bar. To stop the data load job, click Stop.

    When you have added all of the sources for the job and specified the settings for each source, to run the job click the Start icon in the Data Load Cart menu bar. In the Run Data Load Job dialog box, click Start. To stop the data load job, click the Stop icon.

    Once the data load job starts, you can view the progress of the job in the Data Load dashboard.

    When the data load job completes, the Data Load dashboard page displays the results of the job. At the top of the header of the table load, you can view the name of the table along with the total columns present in the table.

    Click Job Report to view the total number of rows processed successfully and the count of rejected rows. You can also view the Start time. The SQL pane of the Job Report displays the equivalent SQL code of the job.

    To view information about an item in the job, click the Actions icon on the Table Load.

    To view a log of the load operation, click the Logging icon. You can save the log, clear it, or refresh it. Click OK to dismiss the log.

View Details of Data Load Job

To view details about the data load job after it is run, click the Actions icon on the Table and View Loads section of the Data Load dashboard.

You can view Table details, Gather Statistics, Register to Cloud Link, Create Analytic View, Export Data to Cloud, Edit Table and delete the table.

When the data load job completes, the Data Load dashboard page displays the results of the job. At the top of the header of the table load, you can view the name of the table along with the total columns present in the table.

Click Report to view the total number of rows processed successfully and the count of rejected rows. You can also view the Start time. The SQL pane of the Report displays the equivalent SQL code of the job.

After your data load job, you might see errors that you want to correct, or upon inspection, realize that you wanted to name a column differently. In such cases, you will view a warning sign on the Table load. Click the Reload icon to reload source with suggested fixes. Click Actions icon on the Table load and select Edit to make any changes to the data load job (i.e., change a column name).

View the Table Resulting from the Data Load Job

To view the new tables or tables modified by the data load job, you can:

  1. Fix your data load job. After your data load job, you might see errors that you want to correct, or upon inspection, realize that you wanted to name a column differently. In such cases, click the Reload option on the selected Table Load to reload cards from your recent cart and edit them as you did before your first attempt. The Reload icon reloads the source data with the fixes suggested by the tool. Click the Actions icon on the Table header, click Table and select Edit to make any changes to the data load job (i.e., change a column name).

  2. You can use the Edit icon as mentioned in the above paragraph to review the table.