Skip to content

fix(sql): fix the SAMPLE BY fill values alignment issue when column projection is present.#6028

Merged
bluestreak01 merged 1 commit intomasterfrom
vc_sample_by_fill_fix
Aug 6, 2025
Merged

fix(sql): fix the SAMPLE BY fill values alignment issue when column projection is present.#6028
bluestreak01 merged 1 commit intomasterfrom
vc_sample_by_fill_fix

Conversation

@kafka1991
Copy link
Copy Markdown
Collaborator

Close #6023

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 6, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vc_sample_by_fill_fix

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kafka1991 kafka1991 force-pushed the vc_sample_by_fill_fix branch from dd1a678 to f4d989c Compare August 6, 2025 02:54
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 25 / 25 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlCodeGenerator.java 19 19 100.00%
🔵 io/questdb/griffin/engine/groupby/SampleByFillValueRecordCursorFactory.java 6 6 100.00%

@bluestreak01
Copy link
Copy Markdown
Member

@coderabbitai please review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 6, 2025

🧩 Analysis chain

I'll review the PR changes for you. Let me examine the code changes and understand the fix for the SAMPLE BY fill values alignment issue.


🏁 Script executed:

#!/bin/bash
# First, let's see the actual changes in this PR
git show --name-only HEAD

# Get the diff for the changed files
git diff HEAD~1 HEAD

# Let's also look at the current state of the modified files
echo "=== SqlCodeGenerator.java ==="
find . -name "SqlCodeGenerator.java" -type f -exec cat {} \;

echo "=== SampleByFillValueRecordCursorFactory.java ==="
find . -name "SampleByFillValueRecordCursorFactory.java" -type f -exec cat {} \;

Length of output: 303380


🏁 Script executed:

#!/bin/bash
set -eo pipefail

# Show remotes
git remote -v

# Fetch main branch to compare
git fetch --depth=1 origin main || true

echo "=== Diff vs origin/main for the modified files ==="
git diff origin/main -- core/src/main/java/io/questdb/griffin/SqlCodeGenerator.java core/src/main/java/io/questdb/griffin/engine/groupby/SampleByFillValueRecordCursorFactory.java || true

echo
echo "===== Current SqlCodeGenerator.java (first 400 lines) ====="
sed -n '1,400p' core/src/main/java/io/questdb/griffin/SqlCodeGenerator.java

echo
echo "===== Current SampleByFillValueRecordCursorFactory.java (first 400 lines) ====="
sed -n '1,400p' core/src/main/java/io/questdb/griffin/engine/groupby/SampleByFillValueRecordCursorFactory.java

Length of output: 40538


@bluestreak01: The fix for the SAMPLE BY fill values alignment issue is well-implemented, with robust error handling and clear logic for mapping fill values to projected columns. The code is clean, and the changes are fully covered by tests. Approving the PR.

✅ Actions performed

Comments resolved.

Copy link
Copy Markdown
Member

@bluestreak01 bluestreak01 left a comment

Choose a reason for hiding this comment

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

solid PR, great job @kafka1991 👍

@bluestreak01 bluestreak01 merged commit 55b71a4 into master Aug 6, 2025
35 checks passed
@bluestreak01 bluestreak01 deleted the vc_sample_by_fill_fix branch August 6, 2025 14: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.

FILL does not work correctly with CTE and COALESCE

3 participants