Thank you! On Tue, Oct 6, 2015 at 4:50 AM, Michael Armbrust <mich...@databricks.com> wrote:
> Double quotes (") are used to create string literals in HiveQL / Spark > SQL. So you are asking if the string A+B equals the number 2.0. > > You should use backticks (`) to escape weird characters in column names. > > On Mon, Oct 5, 2015 at 12:59 AM, Hemminger Jeff <j...@atware.co.jp> wrote: > >> I have a rather odd use case. I have a DataFrame column name with a + >> value in it. >> The app performs some processing steps before determining the column >> name, and it >> would be much easier to code if I could use the DataFrame filter >> operations with a String. >> >> This demonstrates the issue I am having: >> >> dataFrame.filter(renamed("A+B").equalTo(2.0)).show() >> >> This will return all rows with the column value matching 2.0, as expected. >> >> dataFrame.filter("\"A+B\"=2.0").show() >> >> This executes but does not return the correct results. It returns an >> empty result. >> >> dataFrame.filter("\"A+C\"=2.0").show() >> >> Referencing a non-existent column name returns the same empty result. >> >> Any suggestions? >> >> Jeff >> > >