Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys,
I have a large list of containers that I need to use for my SQL query. However, I keep encountering an error when I try to run the SQL query with the entire list. The error message usually states that a column cannot be found or there are issues with the connection.
To work around this problem, I am looking to retrieve a subset of the containers and use that for my SQL query instead. Specifically, I would like to retrieve the first five or more rows of containers and store them in an array.
However, I am unsure of how to retrieve a subset of rows from the container list. Could you please provide guidance on how I can achieve this?
@pietapa assuming you have container list stored somewhere which you can use. I have used first 5 in load to load first 5 values.
containers:
LOAD concat(chr(39) & container & chr(39) ,',') as list_container;
first 5 LOAD distinct container
FROM Source;
let vContainerList = peek('list_container',0,'containers');
drop table containers;
then, you can pass the list to SQL query like below
query:
SQL select *
FROM TableName
where container in ('$(vContainerList)');
Unfortunately, I tried your solution but it does not work...
VContainerList is still empty...
@pietapa Not sure how you are doing it but if you follow same steps it should not generate NULL