Sort:  

I don’t know if this will help, but one idea is to collect all transaction_ids where logs show ‘error’ from hive-engine api. Then use this list to exclude in HiveSQL query.

For sure that can be done but as far as I have explored till now , you can get the logs data only by going through all the blocks one by one.

Using a for loop , right now it's fetching 1000 blocks in 4 minutes so yeah it takes a long time again.