SlideShare una empresa de Scribd logo
1 de 30
BIG DATA QUERY LANDSCAPE – N1QL AND MORE
Yingyi Bu | Couchbase
©2015 Couchbase Inc. 2
About Myself
 Sr. Software Engineer @ Couchbase
 Committer @ AsterixDB
(Research Project under Apache Incubation)
 PhD Student @ UC Irvine
 N1QL  SQL++
yingyi@couchbase.com
@buyingyi
©2015 Couchbase Inc. 3
Agenda
 Introduction
 Operational Query Processing
 Analytical Query Processing
 Comparison and Unification
 Summary
Introduction
©2015 Couchbase Inc. 5
Research
Projects
Introduction
NoSQL
SQL-on-Hadoop
SQL++
Unification
©2015 Couchbase Inc. 6
 Language Unification Research
 SQL Backward Compatible
 Rich Data Model
 Configurable Semantics
 System Unification Research
 A Single Language Interface
 Scale-out for BothWorkloads
 Resource Scheduling Underneath
Introduction
SQL++
Operational Query Processing
©2015 Couchbase Inc. 8
ArrayList<URI> nodes = new ArrayList<URI>();
// Add one or more nodes of your cluster
nodes.add(URI.create("http://127.0.0.1:8091/pools"));
//Try to connect to the client
CouchbaseClient client = null;
try {
client = new CouchbaseClient(nodes, "default", "");
} catch (Exception e) {
System.err.println("Error connecting toCouchbase: " +
e.getMessage());
System.exit(1);
}
// Put the key-value pair into Couchbase.
client.set("hello", "couchbase!").get();
// Return the result and cast it to string
String result = (String) client.get("hello");
System.out.println(result);
Operational Query Processing
Put
Get
 JSON
 Filtering
 Flatten
 Group-by
 Aggregation
 Join
 Ordering
©2015 Couchbase Inc. 9
N1QL – SQL for NoSQL
 Nested Data
 Heterogeneous Data
 Dynamic typing
[
{
"beer-sample": {
"brewery_id": "bro"
"abv": {"m1":1, "m2“:2},
"category": "North American Lager”,
"type": "beer"
}
},
{
"beer-sample": {
"abv": 9.5,
"brewery_id": "brouwerij"
}
}
]
SELECT
category, type, abv.m1
FROM `beer-sample`
WHERE type = “beer”
[
{
"category": "North
American Lager",
"type": "beer”,
"m1": 1
}
]
 Standard SELECT pipeline
 Joins, subqueries, set operators
 UNNEST and NEST
©2015 Couchbase Inc. 10
Cassandra
 SQL-like query language
Feature N1QL Cassandra
Lookup ✔ ✔
Filtering ✔ ✔
Ordering ✔ ✔
Aggregation ✔ ✖
Join ✔ ✖
Subqueries ✔ ✖
Unnest ✔ ✖
Schema-free ✔ ✖
SELECT firstname, lastname FROM users
WHERE birth_year = 1981 AND country = 'FR'
ALLOW FILTERING;
SELECT * FROM postsWHERE userid='john
doe' AND (blog_title, posted_at) > ('John''s
Blog', '2012-01-01')
©2015 Couchbase Inc. 11
MongoDB
 JavaScript-like language
Feature N1QL MongoDB
Lookup ✔ ✔
Filtering ✔ ✔
Ordering ✔ ✔
Aggregation ✔ ✔
Join ✔ ✖
Subqueries ✔ ✖
Unnest ✔ ✔
Schema-free ✔ ✔
db.sales.aggregate(
[
{
$group : {
_id : { month: { $month: "$date" }, day:
{ $dayOfMonth: "$date" }, year: { $year: "$date" } },
totalPrice: { $sum: { $multiply: [ "$price",
"$quantity" ] } },
averageQuantity: { $avg: "$quantity" },
count: { $sum: 1 }
}
}
]
)
db.users.find( { age: { $gt: 18 } }, { name: 1, address: 1 } ).limit(5)
Analytical Query Processing
©2015 Couchbase Inc. 13
Hive
INSERT OVERWRITE TABLE school_summary
SELECT subq1.school, COUNT(1)
FROM (SELECT a.status, b.school, b.gender
FROM status_updates a JOIN profiles b
ON (a.userid = b.userid
AND a.ds='2009-03-20' )) subq1
GROUP BY subq1.school
ProjectProject
Scan (a)
Filter
Scan (b)
ReduceSink ReduceSink
Join
Group-by
FileSink
Scan
ReduceSink
Group-by
FileSink
M1
R1
M2
R2 More data types than SQL
 Hadoop orTez as runtime
©2015 Couchbase Inc. 14
Impala
INSERT OVERWRITE TABLE
school_summary
SELECT subq1.school, COUNT(1)
FROM (SELECT a.status, b.school, b.gender
FROM status_updates a JOIN profiles b
ON (a.userid = b.userid
AND a.ds='2009-03-20' )) subq1
GROUP BY subq1.school
ProjectProject
Filter HDFS Scan (b)
Hash Join
HDFS Scan (a)
Pre-Agg
Merge-Agg
HDFS Write
 ANSI SQL-92
 HDFS/HBase as the storage
 Native MPP execution engine
©2015 Couchbase Inc. 15
Spark SQL
ctx = new HiveContext()
users = ctx.table("users")
young = users.where(users("age") < 21)
println(young.count())
SELECT count(*) FROM users
where age < 21
SQL DataFrames
SQL
DataFrames
Unresolved
Logical Plan
Logical
Plan
Physical
Plans
Selected
Physical
Plan
RDDs
CostModel
Catalog
©2015 Couchbase Inc. 16
Drill
 ANSI SQL-92
 Nested Data
 Schema Inference
Centralized schema
 Static
 Managed by DBAs
Self-describing or schema-less
 Dynamic evolving
 Managed by applications
 Embedded in data
 CSV, JSON, Parquet, ORC
Comparison and Unification
©2015 Couchbase Inc. 18
Comparison and Unification
 AsterixDB – System Unification Research
 Query language?
 Language Comparisons
 SQL++ – Language Unification Research
 N1QL and SQL++
SQL++
Unification
Research
Projects
©2015 Couchbase Inc. 19
 NoSQL data model with schema flexibility
 Declarative full-fledged query language (AQL)
 Partitioned native LSM-based storage
 Secondary index (B-Tree, R-Tree, and keyword index)
 Single-row transaction
 Spatial/temporal data types
 External data (HDFS) access and indexing
 Native MPP query execution engine
AsterixDB (Apache incubator)
Operationa
l
Analytical
©2015 Couchbase Inc. 20
Query Language?
SELECT subq1.school, COUNT(1)
FROM (SELECT a.status, a.date, b.school, b.region
FROM status_updates a JOIN profiles b
ON (a.userid = b.userid
AND a.date='2009-03-20' )) subq1
GROUP BY subq1.school
 Relational  JSON
 Nested tuples/collections
 Partial/missing schema
 Heterogeneity
 Complex values
 Replace COUNT(1) with
“(select * from subq1 order by
date limit 3)”;
 “school” is not in the schema of
the “profiles” table
 “school” is missing in some
profiles;
 “school” is a nested tuple.
©2015 Couchbase Inc. 21
Language Comparison: Data Model
System
Top-level
Values
Heterogeneity Arrays Bags Maps
Nested
Tuples
Primitiv
eValues
Hive Bags/Tuples ✖ ✔ ✖ P ✔ ✔
Impala Bags/Tuples ✖ ✖ ✖ ✖ ✖ ✔
Spark SQL Bags/Tuples ✖ ✔ ✖ ✔ ✔ ✔
Drill Bags/Tuples ✖ ✔ ✖ ✔ ✔ ✔
N1QL Bags/Tuples ✔ ✔ ✖ ✖ ✔ ✔
Cassandra Bags/Tuples ✖ P ✖ P ✖ ✔
MongoDB Bags/Tuples ✔ ✔ ✖ ✖ ✔ ✔
AsterixDB AnyValues ✔ ✖ ✔ ✖ ✔ ✔
©2015 Couchbase Inc. 22
Language Comparison:Types
System
Dynamic
Type Check
Static
Type Check
AnyType OpenType UnionType Optional
Hive ✖ ✔ ✖ ✖ ✖ ✖
Impala ✖ ✔ ✖ ✖ ✖ ✖
Spark SQL ✖ ✔ ✖ ✖ ✖ ✖
Drill ✖ ✔ ✖ ✖ ✖ ✖
N1QL ✔ ✖ – –
Cassandra ✖ ✔ ✖ ✖ ✖ ✖
MongoDB ✔ ✖ – –
AsterixDB ✔ ✔ ✔ ✔ ✖ ✔
©2015 Couchbase Inc. 23
Language Comparison: Path Navigation
System
Tuple Nav.
absent
Tuple Nav.
mismatch
Array Nav.
absent
Array Nav.
mismatch
Map Nav.
absent
Map Nav.
mismatch
Hive error error null error null error
Impala error error -- -- -- --
Spark SQL error error error error null error
Drill error error error error null error
N1QL missing missing missing missing -- --
Cassandra error error -- -- -- --
MongoDB missing missing -- -- -- --
AsterixDB null error error error -- --
No Errors!
©2015 Couchbase Inc. 24
Language Comparison: SELECT Clause
System
ProjectTuples
with Non-scalar
Subqueries
ProjectTuples
with Nested
Collections
Project Non-
Tuples
Hive ✖ ✔ ✖
Impala ✖ ✖ ✖
Spark SQL ✖ ✔ ✖
Drill ✖ ✔ ✖
N1QL ✔ ✔ ✔
Cassandra ✖ ✖ ✖
MongoDB ✖ ✔ ✔
AsterixDB ✔ ✔ ✔
©2015 Couchbase Inc. 25
Language Comparison: FROM Clause
System Subquery Joins
Inner
Unnest
Outer
Unnest
Ordinal
Positions
Hive ✔ ✔ ✔ ✔ ✔
Impala ✔ ✔ ✖ ✖ ✖
Spark SQL ✔ ✔ ✖ ✖ ✖
Drill ✔ ✔ ✔ ✖ ✖
N1QL ✔ ✔ ✔ ✔ ✖
Cassandra ✖ ✖ ✖ ✖ ✖
MongoDB ✖ ✖ ✔ ✖ ✖
AsterixDB ✔ ✔ ✔ ✖ ✔
©2015 Couchbase Inc. 26
 JSON data model
 INNER/OUTER FLATTEN CLAUSE
 Arbitrary subqueries in SELECT
 Configurable parameters for semantics
 Path navigations
 Equality evaluations
 Collection coercions
SQL++ (The “++” Part)
Supported by N1QL!
Made consistent in N1QL!
©2015 Couchbase Inc. 27
SQL++ Configuration for N1QL
Configuration Parameter Value Parameter Value
@path
tuple_nav.absent missing tuple_nav.type_mismatch missing
array_nav.absent missing array_nav.type_mismatch missing
map_nav.absent missing map_nav.type_mismatch missing
@eq
complex yes type_mismatch false
null_eq_null null null_eq_value null
null_eq_missing missing missing_eq_missing missing
missing_eq_value missing null_and_missing missing
null_and_true null null_and_null null
missing_and_true missing missing_and_missing missing
Summary
N1QL in a Bigger Context
©2015 Couchbase Inc. 29
 Operational Query Processing
 Rich Data Model
 SQL is BACK, but with EXTENSIONS!
 Analytical Query Processing
 Rich Data Model is a MUST!
 Unification
 The trend!
Summary
Thank you.
Q & A

Más contenido relacionado

La actualidad más candente

SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.Julian Hyde
 
Lightning fast analytics with Cassandra and Spark
Lightning fast analytics with Cassandra and SparkLightning fast analytics with Cassandra and Spark
Lightning fast analytics with Cassandra and SparkVictor Coustenoble
 
OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityCurtis Mosters
 
What's new in Mondrian 4?
What's new in Mondrian 4?What's new in Mondrian 4?
What's new in Mondrian 4?Julian Hyde
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For HadoopCloudera, Inc.
 
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)Streaming SQL (at FlinkForward, Berlin, 2016/09/12)
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)Julian Hyde
 
Introduction to Apache Drill - interactive query and analysis at scale
Introduction to Apache Drill - interactive query and analysis at scaleIntroduction to Apache Drill - interactive query and analysis at scale
Introduction to Apache Drill - interactive query and analysis at scaleMapR Technologies
 
Discardable In-Memory Materialized Queries With Hadoop
Discardable In-Memory Materialized Queries With HadoopDiscardable In-Memory Materialized Queries With Hadoop
Discardable In-Memory Materialized Queries With HadoopJulian Hyde
 
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...Julian Hyde
 
Sasi, cassandra on full text search ride
Sasi, cassandra on full text search rideSasi, cassandra on full text search ride
Sasi, cassandra on full text search rideDuyhai Doan
 
Spark ETL Techniques - Creating An Optimal Fantasy Baseball Roster
Spark ETL Techniques - Creating An Optimal Fantasy Baseball RosterSpark ETL Techniques - Creating An Optimal Fantasy Baseball Roster
Spark ETL Techniques - Creating An Optimal Fantasy Baseball RosterDon Drake
 
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...guest5b1607
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Konrad Malawski
 
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase Cloudera, Inc.
 
Killing ETL with Apache Drill
Killing ETL with Apache DrillKilling ETL with Apache Drill
Killing ETL with Apache DrillCharles Givre
 
Heuritech: Apache Spark REX
Heuritech: Apache Spark REXHeuritech: Apache Spark REX
Heuritech: Apache Spark REXdidmarin
 
Introduction to the Hadoop Ecosystem (codemotion Edition)
Introduction to the Hadoop Ecosystem (codemotion Edition)Introduction to the Hadoop Ecosystem (codemotion Edition)
Introduction to the Hadoop Ecosystem (codemotion Edition)Uwe Printz
 
Lightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and CassandraLightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and CassandraRustam Aliyev
 
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleBucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleDatabricks
 

La actualidad más candente (20)

SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.SQL Now! How Optiq brings the best of SQL to NoSQL data.
SQL Now! How Optiq brings the best of SQL to NoSQL data.
 
Lightning fast analytics with Cassandra and Spark
Lightning fast analytics with Cassandra and SparkLightning fast analytics with Cassandra and Spark
Lightning fast analytics with Cassandra and Spark
 
OrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionalityOrientDB vs Neo4j - Comparison of query/speed/functionality
OrientDB vs Neo4j - Comparison of query/speed/functionality
 
Streaming SQL
Streaming SQLStreaming SQL
Streaming SQL
 
What's new in Mondrian 4?
What's new in Mondrian 4?What's new in Mondrian 4?
What's new in Mondrian 4?
 
Hw09 Sqoop Database Import For Hadoop
Hw09   Sqoop Database Import For HadoopHw09   Sqoop Database Import For Hadoop
Hw09 Sqoop Database Import For Hadoop
 
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)Streaming SQL (at FlinkForward, Berlin, 2016/09/12)
Streaming SQL (at FlinkForward, Berlin, 2016/09/12)
 
Introduction to Apache Drill - interactive query and analysis at scale
Introduction to Apache Drill - interactive query and analysis at scaleIntroduction to Apache Drill - interactive query and analysis at scale
Introduction to Apache Drill - interactive query and analysis at scale
 
Discardable In-Memory Materialized Queries With Hadoop
Discardable In-Memory Materialized Queries With HadoopDiscardable In-Memory Materialized Queries With Hadoop
Discardable In-Memory Materialized Queries With Hadoop
 
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
Data all over the place! How SQL and Apache Calcite bring sanity to streaming...
 
Sasi, cassandra on full text search ride
Sasi, cassandra on full text search rideSasi, cassandra on full text search ride
Sasi, cassandra on full text search ride
 
Spark ETL Techniques - Creating An Optimal Fantasy Baseball Roster
Spark ETL Techniques - Creating An Optimal Fantasy Baseball RosterSpark ETL Techniques - Creating An Optimal Fantasy Baseball Roster
Spark ETL Techniques - Creating An Optimal Fantasy Baseball Roster
 
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...
Text Analytics Summit 2009 - Roddy Lindsay - "Social Media, Happiness, Petaby...
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014
 
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase
HBaseCon 2013: Honeycomb - MySQL Backed by Apache HBase
 
Killing ETL with Apache Drill
Killing ETL with Apache DrillKilling ETL with Apache Drill
Killing ETL with Apache Drill
 
Heuritech: Apache Spark REX
Heuritech: Apache Spark REXHeuritech: Apache Spark REX
Heuritech: Apache Spark REX
 
Introduction to the Hadoop Ecosystem (codemotion Edition)
Introduction to the Hadoop Ecosystem (codemotion Edition)Introduction to the Hadoop Ecosystem (codemotion Edition)
Introduction to the Hadoop Ecosystem (codemotion Edition)
 
Lightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and CassandraLightning fast analytics with Spark and Cassandra
Lightning fast analytics with Spark and Cassandra
 
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing ShuffleBucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
Bucketing 2.0: Improve Spark SQL Performance by Removing Shuffle
 

Similar a Cb15 presentation-yingyi

Enterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLEnterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLKeshav Murthy
 
N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0Keshav Murthy
 
SQL on everything, in memory
SQL on everything, in memorySQL on everything, in memory
SQL on everything, in memoryJulian Hyde
 
Moving from SQL Server to MongoDB
Moving from SQL Server to MongoDBMoving from SQL Server to MongoDB
Moving from SQL Server to MongoDBNick Court
 
Querying Druid in SQL with Superset
Querying Druid in SQL with SupersetQuerying Druid in SQL with Superset
Querying Druid in SQL with SupersetDataWorks Summit
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewMadhur Nawandar
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital.AI
 
Sql on everything with drill
Sql on everything with drillSql on everything with drill
Sql on everything with drillJulien Le Dem
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octParadigma Digital
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQLMichael Rys
 
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data Platforms
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data PlatformsCassandra Summit 2014: Apache Spark - The SDK for All Big Data Platforms
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data PlatformsDataStax Academy
 
The Why, When, and How of NoSQL - A Practical Approach
The Why, When, and How of NoSQL - A Practical ApproachThe Why, When, and How of NoSQL - A Practical Approach
The Why, When, and How of NoSQL - A Practical ApproachDATAVERSITY
 
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightEnterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightPaco Nathan
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3RojaT4
 

Similar a Cb15 presentation-yingyi (20)

Enterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLEnterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QL
 
N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0
 
Polyalgebra
PolyalgebraPolyalgebra
Polyalgebra
 
Couchbase Day
Couchbase DayCouchbase Day
Couchbase Day
 
SQL on everything, in memory
SQL on everything, in memorySQL on everything, in memory
SQL on everything, in memory
 
Moving from SQL Server to MongoDB
Moving from SQL Server to MongoDBMoving from SQL Server to MongoDB
Moving from SQL Server to MongoDB
 
Data virtualization using polybase
Data virtualization using polybaseData virtualization using polybase
Data virtualization using polybase
 
Querying Druid in SQL with Superset
Querying Druid in SQL with SupersetQuerying Druid in SQL with Superset
Querying Druid in SQL with Superset
 
Clogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overviewClogeny Hadoop ecosystem - an overview
Clogeny Hadoop ecosystem - an overview
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
Nosql seminar
Nosql seminarNosql seminar
Nosql seminar
 
מיכאל
מיכאלמיכאל
מיכאל
 
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and SparkVital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
Vital AI MetaQL: Queries Across NoSQL, SQL, Sparql, and Spark
 
Sql on everything with drill
Sql on everything with drillSql on everything with drill
Sql on everything with drill
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
 
Azure Data Lake and U-SQL
Azure Data Lake and U-SQLAzure Data Lake and U-SQL
Azure Data Lake and U-SQL
 
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data Platforms
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data PlatformsCassandra Summit 2014: Apache Spark - The SDK for All Big Data Platforms
Cassandra Summit 2014: Apache Spark - The SDK for All Big Data Platforms
 
The Why, When, and How of NoSQL - A Practical Approach
The Why, When, and How of NoSQL - A Practical ApproachThe Why, When, and How of NoSQL - A Practical Approach
The Why, When, and How of NoSQL - A Practical Approach
 
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightEnterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
 
Big data technology unit 3
Big data technology unit 3Big data technology unit 3
Big data technology unit 3
 

Último

Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...nirzagarg
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareGraham Ware
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...Elaine Werffeli
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdfkhraisr
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...kumargunjan9515
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...kumargunjan9515
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...gajnagarg
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themeitharjee
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...gajnagarg
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...gajnagarg
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...HyderabadDolls
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.pptibrahimabdi22
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxchadhar227
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...nirzagarg
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraGovindSinghDasila
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 

Último (20)

Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
Top profile Call Girls In Bihar Sharif [ 7014168258 ] Call Me For Genuine Mod...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Satna [ 7014168258 ] Call Me For Genuine Models We ...
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Vadodara [ 7014168258 ] Call Me For Genuine Models ...
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 

Cb15 presentation-yingyi

  • 1. BIG DATA QUERY LANDSCAPE – N1QL AND MORE Yingyi Bu | Couchbase
  • 2. ©2015 Couchbase Inc. 2 About Myself  Sr. Software Engineer @ Couchbase  Committer @ AsterixDB (Research Project under Apache Incubation)  PhD Student @ UC Irvine  N1QL  SQL++ yingyi@couchbase.com @buyingyi
  • 3. ©2015 Couchbase Inc. 3 Agenda  Introduction  Operational Query Processing  Analytical Query Processing  Comparison and Unification  Summary
  • 5. ©2015 Couchbase Inc. 5 Research Projects Introduction NoSQL SQL-on-Hadoop SQL++ Unification
  • 6. ©2015 Couchbase Inc. 6  Language Unification Research  SQL Backward Compatible  Rich Data Model  Configurable Semantics  System Unification Research  A Single Language Interface  Scale-out for BothWorkloads  Resource Scheduling Underneath Introduction SQL++
  • 8. ©2015 Couchbase Inc. 8 ArrayList<URI> nodes = new ArrayList<URI>(); // Add one or more nodes of your cluster nodes.add(URI.create("http://127.0.0.1:8091/pools")); //Try to connect to the client CouchbaseClient client = null; try { client = new CouchbaseClient(nodes, "default", ""); } catch (Exception e) { System.err.println("Error connecting toCouchbase: " + e.getMessage()); System.exit(1); } // Put the key-value pair into Couchbase. client.set("hello", "couchbase!").get(); // Return the result and cast it to string String result = (String) client.get("hello"); System.out.println(result); Operational Query Processing Put Get  JSON  Filtering  Flatten  Group-by  Aggregation  Join  Ordering
  • 9. ©2015 Couchbase Inc. 9 N1QL – SQL for NoSQL  Nested Data  Heterogeneous Data  Dynamic typing [ { "beer-sample": { "brewery_id": "bro" "abv": {"m1":1, "m2“:2}, "category": "North American Lager”, "type": "beer" } }, { "beer-sample": { "abv": 9.5, "brewery_id": "brouwerij" } } ] SELECT category, type, abv.m1 FROM `beer-sample` WHERE type = “beer” [ { "category": "North American Lager", "type": "beer”, "m1": 1 } ]  Standard SELECT pipeline  Joins, subqueries, set operators  UNNEST and NEST
  • 10. ©2015 Couchbase Inc. 10 Cassandra  SQL-like query language Feature N1QL Cassandra Lookup ✔ ✔ Filtering ✔ ✔ Ordering ✔ ✔ Aggregation ✔ ✖ Join ✔ ✖ Subqueries ✔ ✖ Unnest ✔ ✖ Schema-free ✔ ✖ SELECT firstname, lastname FROM users WHERE birth_year = 1981 AND country = 'FR' ALLOW FILTERING; SELECT * FROM postsWHERE userid='john doe' AND (blog_title, posted_at) > ('John''s Blog', '2012-01-01')
  • 11. ©2015 Couchbase Inc. 11 MongoDB  JavaScript-like language Feature N1QL MongoDB Lookup ✔ ✔ Filtering ✔ ✔ Ordering ✔ ✔ Aggregation ✔ ✔ Join ✔ ✖ Subqueries ✔ ✖ Unnest ✔ ✔ Schema-free ✔ ✔ db.sales.aggregate( [ { $group : { _id : { month: { $month: "$date" }, day: { $dayOfMonth: "$date" }, year: { $year: "$date" } }, totalPrice: { $sum: { $multiply: [ "$price", "$quantity" ] } }, averageQuantity: { $avg: "$quantity" }, count: { $sum: 1 } } } ] ) db.users.find( { age: { $gt: 18 } }, { name: 1, address: 1 } ).limit(5)
  • 13. ©2015 Couchbase Inc. 13 Hive INSERT OVERWRITE TABLE school_summary SELECT subq1.school, COUNT(1) FROM (SELECT a.status, b.school, b.gender FROM status_updates a JOIN profiles b ON (a.userid = b.userid AND a.ds='2009-03-20' )) subq1 GROUP BY subq1.school ProjectProject Scan (a) Filter Scan (b) ReduceSink ReduceSink Join Group-by FileSink Scan ReduceSink Group-by FileSink M1 R1 M2 R2 More data types than SQL  Hadoop orTez as runtime
  • 14. ©2015 Couchbase Inc. 14 Impala INSERT OVERWRITE TABLE school_summary SELECT subq1.school, COUNT(1) FROM (SELECT a.status, b.school, b.gender FROM status_updates a JOIN profiles b ON (a.userid = b.userid AND a.ds='2009-03-20' )) subq1 GROUP BY subq1.school ProjectProject Filter HDFS Scan (b) Hash Join HDFS Scan (a) Pre-Agg Merge-Agg HDFS Write  ANSI SQL-92  HDFS/HBase as the storage  Native MPP execution engine
  • 15. ©2015 Couchbase Inc. 15 Spark SQL ctx = new HiveContext() users = ctx.table("users") young = users.where(users("age") < 21) println(young.count()) SELECT count(*) FROM users where age < 21 SQL DataFrames SQL DataFrames Unresolved Logical Plan Logical Plan Physical Plans Selected Physical Plan RDDs CostModel Catalog
  • 16. ©2015 Couchbase Inc. 16 Drill  ANSI SQL-92  Nested Data  Schema Inference Centralized schema  Static  Managed by DBAs Self-describing or schema-less  Dynamic evolving  Managed by applications  Embedded in data  CSV, JSON, Parquet, ORC
  • 18. ©2015 Couchbase Inc. 18 Comparison and Unification  AsterixDB – System Unification Research  Query language?  Language Comparisons  SQL++ – Language Unification Research  N1QL and SQL++ SQL++ Unification Research Projects
  • 19. ©2015 Couchbase Inc. 19  NoSQL data model with schema flexibility  Declarative full-fledged query language (AQL)  Partitioned native LSM-based storage  Secondary index (B-Tree, R-Tree, and keyword index)  Single-row transaction  Spatial/temporal data types  External data (HDFS) access and indexing  Native MPP query execution engine AsterixDB (Apache incubator) Operationa l Analytical
  • 20. ©2015 Couchbase Inc. 20 Query Language? SELECT subq1.school, COUNT(1) FROM (SELECT a.status, a.date, b.school, b.region FROM status_updates a JOIN profiles b ON (a.userid = b.userid AND a.date='2009-03-20' )) subq1 GROUP BY subq1.school  Relational  JSON  Nested tuples/collections  Partial/missing schema  Heterogeneity  Complex values  Replace COUNT(1) with “(select * from subq1 order by date limit 3)”;  “school” is not in the schema of the “profiles” table  “school” is missing in some profiles;  “school” is a nested tuple.
  • 21. ©2015 Couchbase Inc. 21 Language Comparison: Data Model System Top-level Values Heterogeneity Arrays Bags Maps Nested Tuples Primitiv eValues Hive Bags/Tuples ✖ ✔ ✖ P ✔ ✔ Impala Bags/Tuples ✖ ✖ ✖ ✖ ✖ ✔ Spark SQL Bags/Tuples ✖ ✔ ✖ ✔ ✔ ✔ Drill Bags/Tuples ✖ ✔ ✖ ✔ ✔ ✔ N1QL Bags/Tuples ✔ ✔ ✖ ✖ ✔ ✔ Cassandra Bags/Tuples ✖ P ✖ P ✖ ✔ MongoDB Bags/Tuples ✔ ✔ ✖ ✖ ✔ ✔ AsterixDB AnyValues ✔ ✖ ✔ ✖ ✔ ✔
  • 22. ©2015 Couchbase Inc. 22 Language Comparison:Types System Dynamic Type Check Static Type Check AnyType OpenType UnionType Optional Hive ✖ ✔ ✖ ✖ ✖ ✖ Impala ✖ ✔ ✖ ✖ ✖ ✖ Spark SQL ✖ ✔ ✖ ✖ ✖ ✖ Drill ✖ ✔ ✖ ✖ ✖ ✖ N1QL ✔ ✖ – – Cassandra ✖ ✔ ✖ ✖ ✖ ✖ MongoDB ✔ ✖ – – AsterixDB ✔ ✔ ✔ ✔ ✖ ✔
  • 23. ©2015 Couchbase Inc. 23 Language Comparison: Path Navigation System Tuple Nav. absent Tuple Nav. mismatch Array Nav. absent Array Nav. mismatch Map Nav. absent Map Nav. mismatch Hive error error null error null error Impala error error -- -- -- -- Spark SQL error error error error null error Drill error error error error null error N1QL missing missing missing missing -- -- Cassandra error error -- -- -- -- MongoDB missing missing -- -- -- -- AsterixDB null error error error -- -- No Errors!
  • 24. ©2015 Couchbase Inc. 24 Language Comparison: SELECT Clause System ProjectTuples with Non-scalar Subqueries ProjectTuples with Nested Collections Project Non- Tuples Hive ✖ ✔ ✖ Impala ✖ ✖ ✖ Spark SQL ✖ ✔ ✖ Drill ✖ ✔ ✖ N1QL ✔ ✔ ✔ Cassandra ✖ ✖ ✖ MongoDB ✖ ✔ ✔ AsterixDB ✔ ✔ ✔
  • 25. ©2015 Couchbase Inc. 25 Language Comparison: FROM Clause System Subquery Joins Inner Unnest Outer Unnest Ordinal Positions Hive ✔ ✔ ✔ ✔ ✔ Impala ✔ ✔ ✖ ✖ ✖ Spark SQL ✔ ✔ ✖ ✖ ✖ Drill ✔ ✔ ✔ ✖ ✖ N1QL ✔ ✔ ✔ ✔ ✖ Cassandra ✖ ✖ ✖ ✖ ✖ MongoDB ✖ ✖ ✔ ✖ ✖ AsterixDB ✔ ✔ ✔ ✖ ✔
  • 26. ©2015 Couchbase Inc. 26  JSON data model  INNER/OUTER FLATTEN CLAUSE  Arbitrary subqueries in SELECT  Configurable parameters for semantics  Path navigations  Equality evaluations  Collection coercions SQL++ (The “++” Part) Supported by N1QL! Made consistent in N1QL!
  • 27. ©2015 Couchbase Inc. 27 SQL++ Configuration for N1QL Configuration Parameter Value Parameter Value @path tuple_nav.absent missing tuple_nav.type_mismatch missing array_nav.absent missing array_nav.type_mismatch missing map_nav.absent missing map_nav.type_mismatch missing @eq complex yes type_mismatch false null_eq_null null null_eq_value null null_eq_missing missing missing_eq_missing missing missing_eq_value missing null_and_missing missing null_and_true null null_and_null null missing_and_true missing missing_and_missing missing
  • 28. Summary N1QL in a Bigger Context
  • 29. ©2015 Couchbase Inc. 29  Operational Query Processing  Rich Data Model  SQL is BACK, but with EXTENSIONS!  Analytical Query Processing  Rich Data Model is a MUST!  Unification  The trend! Summary