Thanks Yin. That worked for me. Much appreciated! On 10 February 2015 at 16:34, Yin Huai <[email protected]> wrote:
> Can you try using backticks to quote the field name? Like `f:price`. > > On Tue, Feb 10, 2015 at 5:47 AM, presence2001 <[email protected] > > wrote: > >> Hi list, >> >> I have some data with a field name of f:price (it's actually part of a >> JSON >> structure loaded from ElasticSearch via elasticsearch-hadoop connector, >> but >> I don't think that's significant here). I'm struggling to figure out how >> to >> express that in a Spark SQL SELECT statement without generating an error >> (and haven't been able to find any similar examples in the documentation). >> >> val productsRdd = sqlContext.sql("SELECT >> Locales.Invariant.Metadata.item.f:price FROM products LIMIT 10") >> >> gives me the following error... >> >> java.lang.RuntimeException: [1.41] failure: ``UNION'' expected but `:' >> found >> >> Changing the column name is one option, but I have other systems depending >> on this right now so it's not a trivial exercise. :( >> >> I'm using Spark 1.2. >> >> Thanks in advance for any advice / help. >> >> >> >> -- >> View this message in context: >> http://apache-spark-user-list.1001560.n3.nabble.com/Spark-SQL-Column-name-including-a-colon-in-a-SELECT-clause-tp21576.html >> Sent from the Apache Spark User List mailing list archive at Nabble.com. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > -- Neil Andrassy | CTO | The Filter phone | +44 (0)1225 588 004 skype | andrassynp
