Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Optiq: a SQL front-end for everything


Published on

Optiq is a dynamic query planning framework. It can potentially help integrate Pentaho Mondrian and Kettle with various SQL, NoSQL and BigData data sources.

Published in: Technology
  • Be the first to comment

Optiq: a SQL front-end for everything

  1. 1. Optiq: a SQL front-end for everything Julian Hyde @julianhyde Pentaho Community Meetup Amsterdam, 2012
  2. 2.
  3. 3.
  4. 4. “Big Data”Right data, right timeDiverse data sources / Performance / Suitable format
  5. 5. Use case: Splunk NoSQL database Every log file in the enterprise A single “table” A record for every line in every log file A column for every field that exists in any log file No schema SELECT “source”, “product_id”, “http_code” FROM “splunk”.”splunk” WHERE “action” = purchase
  6. 6. How do it (wrong) action = purchase “search” Splunk Optiq filterSELECT “source”, “product_id”FROM “splunk”.”splunk”WHERE “action” = purchase
  7. 7. How do it (right) “search action=purchase” Splunk OptiqSELECT “source”, “product_id”FROM “splunk”.”splunk”WHERE “action” = purchase
  8. 8. Example #2Combining data from 2 sources (Splunk & MySQL)Also possible: 3 or more sources; 3-way joins; unions
  9. 9. Expression tree SELECT p.“product_name”, COUNT(*) AS c FROM “splunk”.”splunk” AS s JOIN “mysql”.”products” AS p ON s.”product_id” = p.”product_id” WHERE s.“action” = purchase Splunk GROUP BY p.”product_name” ORDER BY c DESCTable: splunk Key: product_name Key: product_id Agg: count Condition: Key: c DESC action = purchase scan join MySQL filter group sort scan Table: products
  10. 10. Expression tree SELECT p.“product_name”, COUNT(*) AS c FROM “splunk”.”splunk” AS s(optimized) JOIN “mysql”.”products” AS p ON s.”product_id” = p.”product_id” WHERE s.“action” = purchase GROUP BY p.”product_name” Splunk ORDER BY c DESC Condition: Table: splunk action = purchase Key: product_name Agg: count Key: c DESC Key: product_id scan filter MySQL join group sort scan Table: products
  11. 11. Optiq is not a database.
  12. 12.
  13. 13.
  14. 14. Conventional database architecture JDBC client JDBC server SQL parser / validator Metadata Query optimizer Data-flow operators Data Data
  15. 15. Optiq architecture JDBC client JDBC server Optional SQL parser / Metadata validator SPI Core Query Pluggable optimizer rules 3rd 3rd Pluggable party party ops ops3rd party 3rd party data data
  16. 16. What is Optiq?A really, really smart JDBC driverFrameworkPotential core of a data management system
  17. 17. Writing an adapterDriver – if you want a vanity URL like “jdbc:splunk:”Schema – describes what tables exist (Splunk has just one)Table – what are the columns, and how to get the data. (Splunks table has any column you like... just ask for it.)Operators (optional) – non-relational operationsRules (optional, but recommended) – improve efficiency by changing the questionParser (optional) – to query via a language other than SQL
  18. 18.
  19. 19. Optiq roadmap ideasMondrian use Optiq to read from data sources such as Splunk & MongoDB, combine multiple data sourcesKettle integration: JDBC front-end; optimize jobs; push down filters & aggregations to data sources (e.g. SQL database)Adapters: Cascading, MongoDB, Hbase, Apache Drill, …?Front-ends: linq4j, Scala SLICK, Java8 streamsContributions
  20. 20. ConclusionsLiberate your data!Optiq is a frameworkBuild & share Optiq adapters
  21. 21. Questions?@julianhydehttp://julianhyde.blogspot.com
  22. 22. Additional material: The following queries were used in the demoselect s."source", s."sourcetype" select * from "mysql"."products"; from "splunk"."splunk" as s; select p."product_name",select s."source", s."action" s."sourcetype", s."action" from "splunk"."splunk" as s from "splunk"."splunk" as s join "mysql"."products" as pwhere s."action" = purchase; on s."product_id" = p."product_id";select s."source",