I’m planning to fetch the data from a table using “Snowflake select snap” while putting the condition of getting 1k records ONLY in WHERE clause however it is not getting any results.
I can put the entire query in “Snowflake execute snap” as well but wanting to do with Snowflake Select as of now. Any help is highly appreciable.
You can use the “Limit rows” property to specify the number of rows to be returned by the query.
You should use LIMIT for limiting the output of records.
Does that mean, I would never be able to get 1k records from the Snowflake DB?
Today, the requirement is to fetch 1k records, tomorrow it may be 5k, 10k, so on and so forth.
I’m actually putting those IDs in the WHERE clause so it might exceed the character limit of 255 characters.
I tried limiting it but I want all those 1k records, am I doing the right thing by putting 1k IDs in the WHERE clause of Snowflake Select snap?
Still brand new to snapLogic so I’m sure there would be something where I’m making a mistake.
You have a particular set of IDs you want to process, and that set counts 1000 records? Or you just want the first 1000 from the table?
I’ve a specific set of 1000 IDs as of today, tomorrow it could be 5k, 0.5k or even 40k. Due to limited knowledge, I’m putting those IDs in the where clause of the query.
Are you executing the pipeline, or just validating?
Both validating and executing…
That’s strange. Can you show us the current setup of the snap?
Sure, below snaps for your reference:
There’s no need for the expression functionality (equal sign (=)) button to be on in both situations, unless you’re using some function later in the where clause. Other than that, I can see that you have a new line character ‘\n’ in the query itself, so you should replace those with new lines or space.
Even if I remove the “=” decorator, the query doesn’t run. Moreover, regarding \n, there is none in the query but the error message still shows that → this is where I’m blown away.
I appreciate your detailed attention though.
If you are allowed to, send the query without IDs in the where clause. Make sure you use the
Preformatted text option when pasting the query.
How do I send IDs without where clause in the query? Is there any snap which will help me with the same?
Sorry, I didn’t explained myself correctly. I meant send the query here, without the ids.
There you go:
*** removed where clause ***
The query seems ok. What’s the situation when you turn off the expression support? What’s the output of the Select snap when you validate?
Getting a different error this time:
Index out of bounds; I believe is because of those 1000 IDs. I can remove those 1k IDs and validate the error again.
Getting the same error even though reducing the IDs in where clause to 6:
Also the query has been limited to 10 records too.