An unstructured data processing framework is added for MaxCompute 2.0, supporting access to the OSS and Table Store using external tables. Studio provides some code templates for the framework, facilitating users' fast development.
- After the MaxCompute Java Module (Sample code is provided in the unstructured folder of the examples directory for your reference).
- Right-click the module source code new, and select MaxCompute Java. select
- Specify Name and Kind. For example, set Name to myun.MyExtractor and Kind to Extractor. Click OK.
- The framework code has been automatically filled in the template. Compile your logic code.
- Compile Outputter and StorageHandler by following the preceding steps.
You can compile the unit test (UT) by following the examples in the examples directory to test your Extractor/Outputter.
Package and upload
After StorageHandler/Extractor/Outputter is compiled, compress the completed Java program to a JAR package, and upload the package as a resource to the server, see Package and release.
Create External Table
Right-click scripts and select .
- Enter the SQL script name. Select the MaxCompute project in which the script is to be executed for Target Project and click OK.
- Select create external table live template in the editor to rapidly insert the script
template for creating an external table.
Modify the external table name, column, type, StorageHanlder class path, configuration parameter, external path, and JAR name. Click Run MaxCompute SQL Script to create the external table.
- Query the created external table.