Consider the following rules and guidelines when you configure an SQL query:
When you select the source type as Query, you can override a SQL query over a custom query by setting the flag
precedenceToSQLOverrideOverCustomQuery=True
in the JVM option. Ensure that the number of columns in the overridden SQL query is same as the custom query.
When you run a mapping in advanced mode and define a SQL query with alldatatypes, the target columns with the boolean data type appear as NULL.
When you select individual columns but not all the columns in an SQL query in a mapping in advanced mode, the values are written as NULL to the Redshift target.