Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

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

avatar

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”