Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@nablaone
Copy link
Member

@nablaone nablaone commented Jun 23, 2025

This PR fixes getting mappings and fields caps for all indices.
Details:

  • Added * resolve in mapping endpoint,
  • Added 'Meta' pipeline in the table resolver. It doesn't check if we are trying to query multiple tables. It's not required while handling metadata (mappings, field caps)
  • Added e2e tests.

@nablaone nablaone changed the title Fix /*/_mapping and /*/_field_caps handling Fix /*/_mapping and /*/_field_caps handling Jun 23, 2025
@nablaone nablaone marked this pull request as ready for review June 23, 2025 15:01
@nablaone nablaone requested a review from a team as a code owner June 23, 2025 15:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request addresses issues with handling mappings and field capabilities for all indices by introducing a Meta pipeline and updating the table resolver logic. Key changes include:

  • Adding a MetaPipeline constant and associated resolver support.
  • Refactoring decision merging to use a basicDecisionMerger interface.
  • Enhancing endpoint handlers and e2e tests to properly filter out a common table index.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
platform/v2/core/decision.go Added MetaPipeline constant.
platform/table_resolver/table_resolver.go Changed decisionMerger to an interface; updated index update logic.
platform/table_resolver/rules.go Modified basicDecisionMerger implementation and usage.
platform/processors/es_to_ch_query/elasticsearch_to_clickhouse_query_processor.go Updated HandleGetIndexMapping call to include context and log manager.
platform/functionality/field_capabilities/field_caps.go Added filtering of common table from index list.
platform/frontend_connectors/router_v2.go Updated router registrations to use the new MetaPipeline.
platform/frontend_connectors/route_handlers.go Enhanced HandleGetIndexMapping to iterate over filtered indexes.
platform/frontend_connectors/es_responses.go Updated response generation functions for mappings.
http_requests/_mapping.http Added new HTTP request tests for mapping and field_caps endpoints.
ci/it/testcases/test_common_table_and_regular_table.go Added e2e tests for common and regular table handling.
ci/it/integration_test.go Included integration test for the common table scenario.
ci/it/configs/quesma-common-table-and-regular-table.yml.template New configuration template supporting common table along with regular tables.

mappings := elasticsearch.GenerateMappings(hierarchicalSchema)
allMappings := make(map[string]map[string]any)

var filteredIndexes []string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as below, it would be better to filter out common_table in ResolveIndexPattern

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

const (
QueryPipeline = "Query"
IngestPipeline = "Ingest"
MetaPipeline = "Meta"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some concerns about these pipelines, but that's a matter of broader discussion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is quite controversial. We should reassign the responsibility of the table resolver.

@pdelewski
Copy link
Contributor

/run-it

@pdelewski
Copy link
Contributor

It seems that the integration tests currently take more than 10 minutes and are failing due to this time limit.

@pdelewski
Copy link
Contributor

/run-it

@pdelewski pdelewski force-pushed the que-278-quesma-request-failed-common-table-is-not-allowed-to-be branch from e405e4a to 7527a51 Compare June 26, 2025 10:55
@pdelewski
Copy link
Contributor

/run-it

@pdelewski
Copy link
Contributor

IT test passed https://github.com/QuesmaOrg/quesma/actions/runs/15900045282/job/44840736774

@nablaone nablaone added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit 3e14761 Jun 26, 2025
9 of 10 checks passed
@nablaone nablaone deleted the que-278-quesma-request-failed-common-table-is-not-allowed-to-be branch June 26, 2025 11:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants