Begin Fix Pack 11.4.02 information

Compiling programs by using hil.sh

When you compile high-level integration language scripts, the output is a set of Jaql scripts, which are required for execution in the InfoSphere® BigInsights™ environment. Use the hil.sh script to run the language compiler.

Procedure

  1. Open a Linux shell and define HIL_HOME to be $BIGINSIGHTS_HOME/ei.
  2. Run the hil.sh script by using the following command.
    $HIL_HOME/bin/hil.sh [ -f input1.hil ] [ input2.hil ...] -g output.jaql
    		    [ -i inputDirPath ] [ -o outputDirPath ] [ -t tempDirPath ]
    		    [ -p generationPropertiesFile ]
    For example,
    $HIL_HOME/bin/hil.sh -f program.hil -g program.jaql
    Where
    • -i is the input directory
    • -o is the output directory
    • -t is the temporary file directory
    • -p are any generation properties

Results

The example command compiles program.hil into a Jaql program called program.jaql.

Default placeholders are used for all input and output paths in program.jaql. To change these paths, for example, use the following command.
$HIL_HOME/bin/hil.sh -f program1.hil program2.hil -g program.jaql \
-i \"/user/$USER/input\" -o \"/user/$USER/output\"
Note: Code examples use /user/$USER/input (and /user/$USER/output) as example paths, where $USER is the environment variable that contains the user name.
This command compiles the concatenation of program1.hil and program2.hil into program.jaql. The resulting program.jaql uses /user/me/input as the location of its input data. The output goes to /user/me/output.

By default, if no -t option is used, the temporary files go to a temp directory under the output directory. In the case of this example, the temporary files go to the /user/me/output/temp directory.

Notice that you must include the quotation marks around the paths in the -i, -o, and -t options. The values of these options are typically added to Jaql input and output operations as follows.
// The path to the input directory
HILInputDirPath = "/user/me/input";
HILOutputDirPath = "/user/me/output"; 
HILTempDirPath = "/user/me/output" + "/temp";
// Then, in the jaql code, you will find:
...
... read(hdfs( HILInputDirPath + '/' + ... )) 
... write(hdfs( HILOutputDirPath + '/' + ... ))
This method provides the flexibility of using a valid Jaql expression to compute the path. However, if an existing path must be used, then it must be a valid Jaql string expression.

The generate command is the default command in hil.sh. The examples that are shown will work without using generate after hil.sh.

Also, the -f option is optional. If no input script is provided by using the -f option, then hil.sh reads the language script from the console input (stdin). For example, the following two commands create the same result in program.jaql.
$HIL_HOME/bin/hil.sh -f program.hil -g program.jaql
catprogram.hil | $HIL_HOME/bin/hil.sh generate -g program.jaql 

Generation properties (-p) control how the Jaql input and output statements are generated by the language for different objects in a program. The format and usage of the generation properties in Generation properties. The tutorial also contains some examples of these property files.



Last updated: 25 Jun 2015
End Fix Pack 11.4.02 information