Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

ERROR [42000] [Hortonworks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query

avatar
New Contributor

C#- i am using below parameterized query for getting the data from hive

Query- select * from builds_changelogs where array_contains(deliveryconstructuid,?)

Parameter-

OdbcParameter paramdc = new OdbcParameter("@deliveryconstructuid", OdbcType.NVarChar);
paramdc.Value = "1E4272C7D9E64DF8B3DADA3D056F35A1";

 

When i am executing the query it is throwing below error-

ERROR [42000] [Hortonworks][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement: FAILED: ParseException line 1:48 cannot recognize input near '?' 'and' 'array_contains' in expression specification

 

 

 

1 REPLY 1

avatar
Expert Contributor

Hi @JoshiRamesh  In your query the Question Mark (?) symbol is this a value for deliveryconstructuid.

Can you put it in double quotes and check if it works for you

Example

SELECT * FROM my_table
WHERE array_contains(my_array_col, "value1") 

This query will return all rows from “my_table” where “my_array_col” contains “value1”