Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing schema when querying local data. #86

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

trueleo
Copy link
Contributor

@trueleo trueleo commented Sep 2, 2022

Description

Datafusion needs a valid schema to execute a query. If no associated schema found for registered table then datafusion tries to infer that schema. If there are no available listings from which schema can be derived then it fails and returns an error.

This causes entire query to fail and return error response. This is fixed by giving it a proper schema to work with that is already part of metadata. There are however ways that this schema is might not be available maybe first event has happened yet), then we simply return doing no changes to RecordBatch.

Fixes parseablehq/console#14.


This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Datafusion needs a valid schema to execute a query. If no associated schema
found for registered table then datafusion tries to infer that schema. If
there are no available listings from which schema can be derived then it fails
and returns an error.

This causes entire query to fail and return error response. This is fixed by
giving it a proper schema to work with that is already part of metadata.
There are however ways that this schema is might not be available
( maybe first event has happened yet), then we simply return doing no
changes to RecordBatch.

Changes to be committed:
  modified:   server/src/query.rs
@nitisht nitisht merged commit f577e23 into parseablehq:main Sep 2, 2022
@trueleo trueleo deleted the fix_cache_execute branch September 2, 2022 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search query not working properly from console
2 participants