Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

invalidQuery: Syntax error: Unexpected identifier "String" at #257

Closed
clemishow opened this issue Jul 16, 2020 · 6 comments · Fixed by #266
Closed

invalidQuery: Syntax error: Unexpected identifier "String" at #257

clemishow opened this issue Jul 16, 2020 · 6 comments · Fixed by #266
Assignees

Comments

@clemishow
Copy link

clemishow commented Jul 16, 2020

Bug Report

Screenshot 2020-07-16 at 15 45 17

I'm trying to make this query work, but I'm getting an error message.
invalidQuery: Syntax error: Unexpected identifier "String" at [4:36]

#standardSQL
SELECT
 TIMESTAMP(PARSE_DATE('%Y%m%d', _TABLE_SUFFIX)) AS time,
  CAST (param.value.string_valueAS String ) AS metric,
  count(*) AS nb
FROM `neocity.analytics.events_*`, UNNEST(event_params) as param
WHERE
  event_name = 'screen_view' AND
  param.value.string_value != 'null'
GROUP BY 1,2 
ORDER BY 1,2 LIMIT 686

Expected Behavior

CAST (param.value.string_valueAS String ) AS metric,

Put a space between value and AS

Actual Behavior

Error message

Specifications

  • Version: efbcbb838b
  • Platform: AWS Docker
  • Grafana Version: 7.0.5
@Tamirk
Copy link

Tamirk commented Jul 16, 2020

Hi @clemishow can you let us know which version of our plugin you are using

@clemishow
Copy link
Author

1.0.6

@Tamirk
Copy link

Tamirk commented Jul 16, 2020

Ok, We are waiting for 2.0.0 to be officially published, Once publish please test your issue with the latest version and if you still face an issue we'll fix this

@spark2ignite
Copy link
Contributor

spark2ignite commented Jul 16, 2020 via email

@Tamirk
Copy link

Tamirk commented Jul 28, 2020

@clemishow We see an error in your SQL (missing space) can you replace this line

CAST (param.value.string_valueAS String ) AS metric,

With this
CAST (param.value.string_value AS String ) AS metric,

Note: I added a space between param.value.string_value and the AS keyword

@Tamirk Tamirk closed this as completed Jul 28, 2020
@clemishow
Copy link
Author

The error comes from Query Builder which doesn't put the space

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants