See if you can use Global Temporary table Temp Tables - Teiid 9.0 (draft) - Project Documentation Editor to re-design.
Also you can do as view like
create view Y AS select x.groupitem, x.clicks, x.clicks_unique, null FROM (EXEC DBMStrack.native(array_get(VARIABLES.querystrings, 1))) AS w, ARRAYTABLE(w."output" COLUMNS groupitem string, clicks long, clicks_unique long) AS x union all SELECT y.groupitem, null, null, y.visits INTO TEMP_visits FROM (EXEC DBMStrack.native(array_get(VARIABLES.querystrings, 2))) AS w, ARRAYTABLE(w."output" COLUMNS groupitem string, visits long) AS y
Ramesh..
> for each query in my procedure for merging. In this case, the procedures are sequential. Right? How can I work around?
We will parallelize (depending upon the plan / use of transactions) when you have a union or a join in a query expression. So as long as you can express at a top level the merging as a join/union, then the underlying source queries can be executed in parallel. For example:
select ... from (EXEC DBMStrack.native(array_get(VARIABLES.querystrings, 1))) AS w, ARRAYTABLE(w."output" COLUMNS groupitem string, clicks long, clicks_unique long) AS TEMP_clicks, (EXEC DBMStrack.native(array_get(VARIABLES.querystrings, 2))) AS w, ARRAYTABLE(w."output" COLUMNS groupitem string, visits long) AS TEMP_visits where ...
I restructured my virtual procedure as you suggested. It seems that the queries are sent to our data base in parallel.
string length for direct native query: by changing org.teiid.maxStringLength I can increase the lenth to e.g, 8000. But the length of my query is not predicable. In this case, I still get error when the limit 8000 is exceeded. Our database is MySQL and we have really very long queries. Can I work around with this situation?