I am loading some avro data into spark using the following code:

sqlContext.sql("CREATE TEMPORARY TABLE foo USING com.databricks.spark.avro
OPTIONS (path 'hdfs://*.avro')")

The avro data contains some binary fields that get translated to the
BinaryType data type.  I am struggling with how to use the binary type in a
query statement.

For example:
sqlContext.sql("select * from foo where
name='\x00\x00\x0c\x07\xac\x02'").collect()

throws a utf8 error.

Trying this:
sqlContext.sql(u"select * from foo where
name='\x00\x00\x0c\x07\xac\x02'").collect()

does not return any results.

Any thoughts/ideas?



--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Pyspark-query-by-binary-type-tp22431.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

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

Reply via email to