Skip to content

feat: prepend breadcrumb comment to all SQL queries (DX-117497)#9

Open
aniket-s-kulkarni wants to merge 1 commit intodremio:mainfrom
aniket-s-kulkarni:DX-117497-query-breadcrumbs
Open

feat: prepend breadcrumb comment to all SQL queries (DX-117497)#9
aniket-s-kulkarni wants to merge 1 commit intodremio:mainfrom
aniket-s-kulkarni:DX-117497-query-breadcrumbs

Conversation

@aniket-s-kulkarni
Copy link
Collaborator

@aniket-s-kulkarni aniket-s-kulkarni commented Mar 26, 2026

Summary

  • All SQL submitted through dremio-cli now carries a leading breadcrumb comment: /* dremio-cli: submitter=cli */ <user SQL>
  • Enables backend query attribution — the Jobs service can detect CLI-originated queries, consistent with how dremio-mcp uses /* dremioai: submitter=agent */
  • Applied in the single submit_sql() method in client.py, so every command that runs SQL (query, job, schema, folder, reflection) gets it automatically

Test plan

  • 2 new tests in test_client.py verify breadcrumb is prepended (with and without context)
  • Full test suite passes (140/140)
  • Manual: run dremio query run "SELECT 1" against Dremio Cloud and verify the breadcrumb appears in the job's SQL via sys.project.history.jobs

JIRA: DX-117497

🤖 Generated with Claude Code

All SQL submitted through dremio-cli now carries a leading comment:
  /* dremio-cli: submitter=cli */ <user SQL>

This enables backend query attribution — the Jobs service can detect
queries originating from the CLI, consistent with how dremio-mcp
uses /* dremioai: submitter=agent */.

The breadcrumb is added in the single submit_sql() method in client.py,
so every command that runs SQL (query, job, schema, folder, reflection)
gets it automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants