Skip to content

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Oct 20, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

This PR addresses a bug where MapAccess field names within VARIANT computed columns were incorrectly converted to lowercase, leading to NULL values when the original VARIANT data used case-sensitive field names. In the following example the field identifier (videoInfo) was being implicitly converted to lowercase (videoinfo).

CREATE TABLE test(
    id INT,
    data VARIANT,
    name STRING AS (data:videoInfo:name::string) STORED,
    duration INT AS(DATA:videoInfo:duration::int) STORED
);

INSERT INTO test VALUES(1, '{"videoInfo":{"name":"H264","duration":10}}'),(2, '{"videoInfo":{"name":"H265","duration":20}}');

# main branch
SELECT * FROM test;
╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
│        id       │                     data                    │       name       │     duration    │
│ Nullable(Int32) │              Nullable(Variant)              │ Nullable(String) │ Nullable(Int32) │
├─────────────────┼─────────────────────────────────────────────┼──────────────────┼─────────────────┤
│               1 │ {"videoInfo":{"duration":10,"name":"H264"}} │ NULLNULL │
│               2 │ {"videoInfo":{"duration":20,"name":"H265"}} │ NULLNULL │
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯

# This PR
SELECT * FROM test;
╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
│        id       │                     data                    │       name       │     duration    │
│ Nullable(Int32) │              Nullable(Variant)              │ Nullable(String) │ Nullable(Int32) │
├─────────────────┼─────────────────────────────────────────────┼──────────────────┼─────────────────┤
│               1 │ {"videoInfo":{"duration":10,"name":"H264"}} │ H264             │              10 │
│               2 │ {"videoInfo":{"duration":20,"name":"H265"}} │ H265             │              20 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯

This PR also add some logs and remove some unused comments for inverted index.

  • fixes: #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@b41sh b41sh requested a review from sundy-li October 20, 2025 08:29
@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Oct 20, 2025
@b41sh b41sh requested a review from zhyass October 20, 2025 08:35
Copy link
Contributor

github-actions bot commented Oct 20, 2025

🤖 CI Job Analysis

Workflow: 18672381196

📊 Summary

  • Total Jobs: 83
  • Failed Jobs: 2
  • Retryable: 0
  • Code Issues: 2

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / sqllogic / standalone (base, 2c8g, hybrid): Not retryable (Code/Test)
  • linux / sqllogic / cluster (base, 2c8g, 2, hybrid): Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

@b41sh b41sh force-pushed the fix-computed-column-access branch from c85393b to df9ef4d Compare October 21, 2025 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix this PR patches a bug in codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants