Using the Netezza Analytics Matrix Engine
Felt like writing something about the topic due to the lack of available examples out there in the internet. -- initialize the engine CALL NZM..INITIALIZE(); --create some random matrix CALL NZM..CREATE_RANDOM_MATRIX('A', 10, 10); CALL NZM..CREATE_RANDOM_MATRIX('B', 10, 10); --let's try adding the matrix. Put the result in matrix C CALL NZM..ADD('A', 'B', 'C'); --now let's see the result -> create a table from the matrix CALL NZM..CREATE_TABLE_FROM_MATRIX('C', 'TABLE_C'); --look at the content. select * from table_c order by row, col; --to check the results, let's create additional tables from matrix A and B and calculate manually. CALL NZM..CREATE_TABLE_FROM_MATRIX('B', 'TABLE_B'); select * from table_b order by row, col; CALL NZM..CREATE_MATRIX_FROM_TABLE('TABLE_A', 'A', 10, 10); select * from table_b order by row, col; --let's try some real-life application. /* Begin Ego Ne...