Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
hama > a = load 'fileA' as matrix using bulkload.class map 10;
hama > b = load 'fileB' as matrix;
hama > c = a;
hama > d = (a+b) * (c+a) map 20 reduce 1;
hama > save d as 'fileD'

Grammar

No Format
<hamascript><hamaexpression> := <expr> ";"

<expr> := [<alias><IDENTIFIER> "="] <baseexpr><basicoperation> ["MAP" <integer>] ["REDUCE" <integer>] | "SAVE" <IDENTIFIER> "AS" <saveexpr><filename>

<baseexpr><basicoperation> := <operationexpr><algebraop> | "LOAD" <loadexpr><loadop> | <randmatrixop>

<operationexpr><loadop> := <alias> | <operationexpr> <operations> <operationexpr> | "(" <operationexpr> ")" 

<operations> := "LOAD" <filename> "AS" <typename> "USING" <classname>

<randmatrixop> := "MATRIX.RANDOM" <integer> <integer>

<algebraop> := <additiveop>

<additiveop> := <multiplicationop> ( ( "+" | "-" ) |<multiplicationop> ")*"

<loadexpr><multiplicationop> := <unaryop> <filename>( "as*" <type> ["USING" <loadclass> ["MAP" <integer>] ["REDUCE" <integer>] ]

<type><unaryop> )*

<unaryop> := "(" <additiveop> ")" | <IDENTIFIER>

<typename> := "matrix"

<loadclass><filename> := <quotedstring>

<saveexpr> := <alias> "as" <filename>

<filename><classname> := <quotedstring>

<quotedstring> := "'"<string>"'"

...