SQL2 queries that use OUTER JOIN and NAME or LOCALNAME result in a NullPointerException.
For example,
SELECT * FROM [cq:PageContent] AS page LEFT OUTER JOIN [nt:unstructured] AS component ON ISCHILDNODE(component,page) WHERE ISDESCENDANTNODE(page,[/content/geometrixx/en]) AND (NAME(component) = 'par')
Due to a bug in Oak (OAK-4658), outer join queries with the condition "name(joinSelector) = 'x'" or "localname(joinSelector) = 'x'" result in a NullPointerException.
Apply the latest Oak cumulative hot fix for AEM6.2.