spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvuillermet <jeremy.vuiller...@gmail.com>
Subject SQL JSON array operations
Date Thu, 15 Jan 2015 15:02:43 GMT
let's say my json file lines looks like this

{"user": "baz", "tags" : ["foo", "bar"] }
....

sqlContext.jsonFile("data.json")
...
How could I query for user with "bar" tags using SQL

sqlContext.sql("select user from users where tags ?contains? 'bar' ")

I could simplify the request and use the returned RDD to filter on tags but
I'm exploring an app where users can write their SQL queries




--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/SQL-JSON-array-operations-tp21164.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Mime
View raw message