Updated on 2024-08-16 GMT+08:00

Preparing a Presto HCatalog Application Development Environment

To run the HCatalog API sample code of Presto, you need to perform the following operations. The following example develops an application that uses HCatalog to connect to Presto in the Windows environment.

Procedure

  1. Obtain the Presto sample project by referring to Obtaining the MRS Application Development Sample Project.
  2. In the root directory of the Presto sample project, run the mvn install command to perform compilation.
  3. In the root directory of the Presto sample project, run the mvn eclipse:eclipse command to create an Eclipse project.
  4. In the application development environment, import the sample project to the Eclipse development environment.

    1. Choose File > Import > General > Existing Projects into Workspace > Next > Browse.

      The Browse Folder dialog box is displayed.

    2. After downloading the project, select the presto-examples folder. On Windows, the folder path cannot contain any space.
    3. Click Finish.

      After successful import, the HCatalogExample class in com.huawei.bigdata.presto.example is the HCatalog API sample code.

  5. Set an Eclipse text file encoding format to prevent garbled characters.

    1. On the Eclipse menu bar, choose Window > Preferences. The Preferences window is displayed.
    2. In the navigation pane on the left, choose General > Workspace. In the Text file encoding area, select Other and set the value to UTF-8. Click Apply and then OK. Figure 1 shows the settings.
      Figure 1 Setting the Eclipse encoding format