Skip to content

Fix result_scan columns for empty records batch #1062

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

Merged
merged 2 commits into from
Jun 11, 2025

Conversation

osipovartem
Copy link
Contributor

@osipovartem osipovartem commented Jun 11, 2025

  • Added schema serialization to ResultSet to handle empty record batches

    • Previously, when the ResultSet contained no rows (empty record batches), the schema was inferred at runtime using infer_json_schema, which sometimes resulted in an empty schema. This caused issues downstream because a valid schema is required even when no data rows are present (e.g., for joins).
    • To address this, extended the ResultSet struct to include a serialized schema field. This allows the schema to be preserved and reused directly, ensuring consistent and complete schema information regardless of the presence of rows.
  • Additionally, enabled the serde feature for arrow-schema to support serialization and deserialization of Schema. This is necessary because DataFusion itself does not enable this feature by default, so we had to explicitly activate it in our build to make schema (de)serialization possible.

Closes #1058 #1037
Related to #1057

Copy link
Contributor

SQL Logic Tests Results ❌

Coverage by SLT File

  • to_json: 0/4 (0.0%)
  • parse_json: 2/8 (25.0%)
  • result_scan: 0/3 (0.0%)

Overall: 2/15 (13.3%)

@osipovartem osipovartem merged commit 4f96d15 into main Jun 11, 2025
6 checks passed
@osipovartem osipovartem deleted the issues/1058_show_objects_col_names branch June 11, 2025 22:15
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.

[BUG] Fix show objects column names
2 participants