private function getFields($tokens, $namingConvention, $class)
    {
        $fields = [];
        $prefix = '';

        foreach ($tokens->getTokens() as $token) {
            if ($token instanceof ByToken) {
                return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
            }

            if ($token instanceof AllToken) {
                return $prefix . $this->fieldsToSQL([], $class, $namingConvention);
            }

            if($token instanceof DistinctToken) {
                $prefix .= 'DISTINCT ';
                continue;
            }

            if ($token instanceof AndToken) {
                // Ignore and tokens as they do nothing
                continue;
            }

            if (!($token instanceof ValueToken)) {
                throw new DslSyntaxException('Unexpected token ' . $token->getName() . ' in field selector', DATADO_UNEXPECTED_TOKEN);
            }

            $fields[] = lcfirst($token->getSource());
        }

        return $prefix . $this->fieldsToSQL($fields, $class, $namingConvention);
    }