Revert "Use correct buildDSRetrievalSQL function instead of the old typo'd version"

This reverts commit 04a22da11170b61f82aac926d0870936e636844b.