Skip to content

[fix](fe) Preserve inferred JSON column name casing - #67411

Open
0AyanamiRei wants to merge 1 commit into
apache:masterfrom
0AyanamiRei:fix/doris-25132-json-key-case-matching
Open

[fix](fe) Preserve inferred JSON column name casing#67411
0AyanamiRei wants to merge 1 commit into
apache:masterfrom
0AyanamiRei:fix/doris-25132-json-key-case-matching

Conversation

@0AyanamiRei

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: JSON schema inference lowercased field names before creating the table-valued function schema, while JSON readers match object keys case-sensitively. Uppercase keys therefore appeared as queryable lowercase columns but were silently materialized as NULL. Preserve the inferred key casing for JSON only, while retaining case-insensitive duplicate detection and the existing lowercase behavior for other file formats.

Release note

JSON table-valued functions now read inferred mixed-case and uppercase keys without silently producing NULL values.

Check List (For Author)

  • Test: Regression test and manual tests
    • Regression test: test_json_uppercase_keys (raw and jsonpaths control)
    • Manual test: File Scanner V2, legacy scanner, and http_stream returned the two expected rows
    • Manual compatibility test: CSV inferred column names remained lowercase
  • Behavior changed: Yes. Inferred JSON field names preserve source casing.
  • Does this need documentation: No

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: JSON schema inference lowercased field names before creating the table-valued function schema, while JSON readers match object keys case-sensitively. Uppercase keys therefore appeared as queryable lowercase columns but were silently materialized as NULL. Preserve the inferred key casing for JSON only, while retaining case-insensitive duplicate detection and the existing lowercase behavior for other file formats.

### Release note

JSON table-valued functions now read inferred mixed-case and uppercase keys without silently producing NULL values.

### Check List (For Author)

- Test: Regression test and manual tests
    - Regression test: test_json_uppercase_keys (raw and jsonpaths control)
    - Manual test: File Scanner V2, legacy scanner, and http_stream returned the two expected rows
    - Manual compatibility test: CSV inferred column names remained lowercase
- Behavior changed: Yes. Inferred JSON field names preserve source casing.
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

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.

2 participants