def test_to_vespa_query_should_include_string_array_fields_when_string_array_attributes_to_retrieve_is_not_empty(self):
        """Tests that string array fields are correctly included in the Vespa query when requested.
        
        This test verifies that when string array fields are included in the attributes_to_retrieve
        parameter of a query, both the original field names and their corresponding Vespa internal
        field names (with the marqo__string_array_ prefix) are included in the generated YQL query.
        
        The test checks this behavior for both tensor queries and lexical queries to ensure
        consistent handling across query types.
        """
        marqo_index = self._semi_structured_marqo_index(name='index1', lexical_field_names=['title'],
                                                        tensor_field_names=['title'], string_array_fields = ['string_array_field1', 'string_array_field2'])
        vespa_index = SemiStructuredVespaIndex(marqo_index)

        for marqo_query in [
            MarqoTensorQuery(index_name=marqo_index.name, limit=10, offset=0,
                             attributes_to_retrieve=['title', 'string_array_field1', 'string_array_field2'], vector_query=[1.0] * 10),
            MarqoLexicalQuery(index_name=marqo_index.name, limit=10, offset=0,
                              attributes_to_retrieve=['title', 'string_array_field1', 'string_array_field2'], and_phrases=['hello'], or_phrases=['world']),
            # MarqoHybridSearch yql is just a placeholder and is generated in customer search component.
        ]:
            with self.subTest(test_query=marqo_query):
                query = vespa_index.to_vespa_query(marqo_query)
                fields = self._extract_fields_from_yql(query['yql'])

                self.assertSetEqual({VESPA_FIELD_ID, 'title', 'marqo__chunks_title',
                                     BOOL_FIELDS, INT_FIELDS, FLOAT_FIELDS,
                                     'string_array_field1', 'string_array_field2', 'marqo__string_array_string_array_field1', 'marqo__string_array_string_array_field2'}, fields)
Tests that string array fields are correctly included in the Vespa query when requested.
        
        This test verifies that when string array fields are included in the attributes_to_retrieve
        parameter of a query, both the original field names and their corresponding Vespa internal
        field names (with the marqo__string_array_ prefix) are included in the generated YQL query.
        
        The test checks this behavior for both tensor queries and lexical queries to ensure
        consistent handling across query types.
        
tests/integ_tests/core/semi_structured_vespa_index/test_semi_structured_vespa_index.py