SelectQuery query = select(source, constraint, orderings, columns, null, false);
// Produce the statement, but use our ExecutionContext (primarily for namespaces and binary value usage) ...
String statement = Visitors.readable(query, context.getExecutionContext());
// Set up the hints ...
PlanHints hints = new PlanHints();
hints.showPlan = true;
hints.hasFullTextSearch = true; // always include the score
hints.qualifyExpandedColumnNames = true; // always qualify expanded names with the selector name in JCR-SQL2
// We want to allow use of residual properties (not in the schemata) for criteria ...
hints.validateColumnExistance = false; // see MODE-1055