This topic describes how to develop a Java program by using MaxCompute Studio and describes related directories.
Follow these steps to develop a Java program in MaxCompute Studio:
MaxCompute Studio automatically creates a module after you create a MaxCompute Java module. The module directory includes the following subdirectories:
- examples: stores sample code. You can reference the sample code to develop a script for unit testing.
- src/main/java: stores source code for Java program development.
- warehouse: stores schemas and data of tables and resources for MaxCompute projects.
The warehouse directory stores the schemas and data of tables and resources for MaxCompute projects. These tables and resources are used to execute user-defined functions (UDFs) or MapReduce tasks.
- The warehouse directory contains three levels of subdirectories. Level-1 subdirectories are named by project name. Level-2 subdirectories include _resources_ and _tables_. Each level-3 subdirectory under _tables_ is named by a table name and contains the _schema_ and data files.
- In a _schema_ file, configure the project name, table name, and names and data types of columns. Separate each pair of column name and data type with a colon (:). If a partitioned table is used, you must specify partition key columns. In the preceding figure, wc_in1 is a non-partitioned table, and wc_in2 is a partitioned table.
- In a data file, table data is stored in the CSV format based on the following rules:
- In special characters, only commas (,), double quotation marks ("), and line breaks
\r\n) are supported.
- A comma (,) is used as a column delimiter.
\r\nis used as a row delimiter.
- If a value in a column contains special characters, enclose the value in a pair of
double quotation marks ("). For example, write
- If a value in a column contains double quotation marks ("), use a pair of double quotation
marks (") to escape each double quotation mark ("). For example, write
\Nindicates a NULL value. For a column of the STRING data type, write
- Characters in the file are encoded in UTF-8.
- In special characters, only commas (,), double quotation marks ("), and line breaks (