reader.sql returns nested structure