There are many reserved identifiers in the google query language. If you want to use one of them as the name of a field, you have to quote it with backticks in your queries: `datetime`, for example. But better to just avoid them, in my opinion...
Mark On Sep 29, 11:36 pm, Robert Brewer <[email protected]> wrote: > I'm writing a data source using the Google Java data source library. I > have run into a strange problem with column identifiers. My data table > consists of a column of DATETIME values, followed by two columns of > NUMBER values. If the identifier for the DATETIME column is > "timestamp", "timeStamp", "dateTime" and a few other things I tried, > any select query I make using that column identifier returns a big > error message. The raw JSON output is reproduced below (hopefully > Google Groups doesn't mangle it): > > google.visualization.Query.setResponse > ({version:'0.6',status:'error',errors: > [{reason:'invalid_query',message:'Invalid > query',detailed_message:'Query error: Encountered \u0022 \u0022,\u0022 > \u0022, \u0022\u0022 at line 1, column 16.\nWas expecting one of:\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL > \u003e ...\n \u003cSTRING_LITERAL\u003e ...\n > \u003cSTRING_LITERAL\u003e ...\n \u003cSTRING_LITERAL\u003e ... > \n \u003cSTRING_LITERAL\u003e ...\n '}]}); > > If use "foo", "thyme", or "dayte" or other identifiers for that > column, everything works fine. Are there are some reserved identifiers > that we should avoid using, or is this just a bug? It's easy enough to > work around this problem by picking another name, but the above error > message doesn't exactly scream out 'change your identifier name'. If > there are reserved identifiers we should avoid, a list of them would > be nice. > > I should mention that I'm quite the Javascript newbie, so if this is > something that should be obvious if you know Javascript, then I > apologize. However, this processing is happening inside the Java > library before it even gets interpreted by the browser, so I'm not > sure how Javascript would come into the picture. > > Mahalo! > > -- > Robert Brewer http://excitedcuriosity.wordpress.com > PhD Student, University of Hawaii at Manoa, Computer Science Dept > Research Assistant in Renewable Energy and Island Sustainability > http://reis.manoa.hawaii.edu --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en -~----------~----~----~----~------~----~------~--~---
