Skip to content
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

feat: add QUERY_TECHNICAL_MARK to all UI queries #1992

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Mar 3, 2025

Closes #1490

Why to mark queries?

  1. UI request to system tables won't be displayed in queries tables
  2. It will be easier to distinguish UI queries from users' queries in case of incidents

Also I added database to all queries, so requests will use absolute paths and work in nested databases. Renamed path to database in some places for clarity

CI Results

Test Status: ✅ PASSED

📊 Full Report

Total Passed Failed Flaky Skipped
264 263 0 0 1
Test Changes Summary ⏭️1

⏭️ Skipped Tests (1)

  1. Streaming query shows some results and banner when stop button is clicked (tenant/queryEditor/queryEditor.test.ts)

Bundle Size: ✅

Current: 80.81 MB | Main: 80.81 MB
Diff: 0.01 KB (-0.00%)

✅ Bundle size unchanged.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@@ -63,27 +65,28 @@ function createShardQueryHistorical(
PeakTime,
InFlightTxCount,
IntervalEnd
FROM \`.sys/top_partitions_one_hour\`
FROM \`${database}/.sys/top_partitions_one_hour\`
Copy link
Collaborator

Choose a reason for hiding this comment

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

If database is empty (as far as I can see - it can be '' because we are checking its value in ternary above) - will /.sys/... be okay as select source?

Copy link
Member Author

Choose a reason for hiding this comment

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

.sys will work, /.sys - won't. However, we alway sent request to specific database, otherwise queries may not work at all (currently I have errors when I sent requests without defined database).

I think it's better to remove ternaries - they have no sense.

Also I found more complex issue, we don't determine db correctly for nested entities, so for nested databases we have wrong db anyway. So actually, there is no difference, whether we pass database or not, .sys path could be relative when db is passed. Probably I revert the changes where I add database to .sys path

Copy link
Member Author

@artemmufazalov artemmufazalov Mar 10, 2025

Choose a reason for hiding this comment

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

Removed unneeded ternaries, database should never be empty or request won't be successful anyway. BTW, these ternaries were not needed even in case of empty string database, YQL processed it correctly, they were needed for the case of undefined database.

Used relative paths everywhere: both in query text and api request we use the same param, so it never differs. If we use relative path, the query will use path from the database, that we passed.

: createShardQueryHistorical(
path,
database,
Copy link
Collaborator

Choose a reason for hiding this comment

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

As I see here path and database can exist simulteneously
Could you please explain the real difference (as somewhere we change path to database and somewhere not)

Copy link
Member Author

Choose a reason for hiding this comment

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

Example: we look at shards of a table db1/table1
Database is db1, it should be used as a request param, system tables in db1/.sys/, but the result should be filtered, so only shards of current path db1/table1 will be shown

Copy link
Member Author

@artemmufazalov artemmufazalov Mar 7, 2025

Choose a reason for hiding this comment

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

path - path to schema object
database - database, where this schema object exists

Copy link
Collaborator

@sareyu sareyu left a comment

Choose a reason for hiding this comment

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

LGTM

@artemmufazalov artemmufazalov added this pull request to the merge queue Mar 10, 2025
Merged via the queue into main with commit 6d53518 Mar 10, 2025
8 checks passed
@artemmufazalov artemmufazalov deleted the 1490-mark-queries branch March 10, 2025 14:55
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.

Add QUERY_TECHNICAL_MARK to all UI queries
3 participants