AFAIK, that isn't possible (But I could be wrong!).
But in one of my implementations, we had a SQL query that was big enough and we ended up using a View to get this. Basically, create a view encapsulating the query.
There are a few advantages to this approach (IMHO):
- You could alias the field names in the query and make use of the convention to map to SOLR schema (Solr field names could be same as Query column names).
- You do not need to deploy SOLR if your query logic(not field selection) changes.
- Your data-config is quite lean and does not hold any business logic.
- It is easier to debug - a 'select * from ' would dump all the data that goes to DIH.