With code
https://github.com/high-performance-spark/high-performance-spark-examples
Let me introduce PL/HQL, an open source tool that implements procedural SQL
can be used with any SQL-on-Hadoop solution.
Motivation:
- Writing the driver code using well-known procedural SQL (not bash)
that enables Hadoop to even more wider audience
- Allowing dynamic SQL, iterations, flow-of-control and SQL exception
handling
- Facilitating migration of RDBMS workload to Hadoop
Plans (besides extending syntax):
- Supporting CREATE PROCEDURE/FUNCTION/PACKAGE to reuse code
- Allowing connections to multiple databases (i.e. lookup tables in
relational databases)
- On-the-fly SQL conversion (SELECT i.e.), compatibility layer
START=$(hplsql -e 'CURRENT_DATE - 1')
COPY (SELECT id, name FROM sales.users WHERE local_dt = CURRENT_DATE) TO /data/users.txt DELIMITER '\t';
COPY sales.users TO sales.users2 AT tdconn;
MAP OBJECT log TO log.log_data AT mysqlconn;
DECLARE cnt INT;
SELECT count(*) INTO cnt FROM sales.users WHERE local_dt = CURRENT_DATE;
INSERT INTO log (message) VALUES ('Number of users: ' || cnt);
CMP SUM sales.users WHERE local_dt = CURRENT_DATE, users_daily AT mysqlconn;
"We coded frantically in parallel: one of us wrote the kernel and the other the client, and we'd debug one of them while leaving the other running in the meantime. It was the perfect blend of pair programming and simultaneous development, and in just two days we had a prototype of a python shell over zmq working."