Skip to content

chore: adjust composed query actions to normalized tables#1076

Merged
MicBun merged 3 commits intofeat/normalized-tablesfrom
chore/update-composed-actions
Jul 18, 2025
Merged

chore: adjust composed query actions to normalized tables#1076
MicBun merged 3 commits intofeat/normalized-tablesfrom
chore/update-composed-actions

Conversation

@williamrusdyputra
Copy link
Contributor

@williamrusdyputra williamrusdyputra commented Jul 17, 2025

resolves: #1073

How Has This Been Tested?

tests passed

@williamrusdyputra williamrusdyputra self-assigned this Jul 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • 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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@williamrusdyputra williamrusdyputra marked this pull request as ready for review July 17, 2025 14:45
@holdex
Copy link

holdex bot commented Jul 17, 2025

Time Submission Status

Member Status Time Action Last Update
williamrusdyputra ✅ Submitted 3h 30min Update time Jul 18, 2025, 7:05 AM
MicBun ✅ Submitted 15min Update time Jul 18, 2025, 9:35 AM

Copy link
Member

@MicBun MicBun left a comment

Choose a reason for hiding this comment

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

lgtm

@MicBun MicBun merged commit 65d8c07 into feat/normalized-tables Jul 18, 2025
7 checks passed
@MicBun MicBun deleted the chore/update-composed-actions branch July 18, 2025 07:14
MicBun pushed a commit that referenced this pull request Aug 12, 2025
* chore: add data providers table

* feat: add data_providers table

* chore: add unique index

* chore: create index if not exists

* chore: normalize streams table (#1046)

* chore: normalize metadata table (#1047)

* chore: normalize taxonomies table (#1053)

* chore: normalize primitive events table (#1054)

* chore: adjust insert actions to normalized tables

* chore: revise error message

* feat: create action for data provider and test

* chore: adjust insert metadata

* feat: adjust insert primitive events

* chore: adjust tests

* chore: adjust tn ops tests

* chore: adjust tests

* chore: optimize stream ids lookup

* fix: variable name

* chore: use inner join

* chore: remove unnecessary select

* chore: use optimized action on truflation query too

* chore: adjust common actions to normalized tables (#1068)

* chore: adjust common actions to normalized tables

* fix: join data providers

* chore: debug

* chore: adjust authorization actions to normalized tables (#1070)

* chore: adjust authorization actions to normalized tables

* chore: update actions

* chore: update actions

* fix: logic

* chore: adjust taxonomy actions to normalized tables (#1074)

* chore: adjust taxonomy actions to normalized tables

* chore: avoid rate limiting on github actions

* chore: adjust primitive query actions to normalized tables (#1075)

* chore: adjust composed query actions to normalized tables (#1076)

* chore: adjust composed query actions to normalized tables

* chore: update derivates

* fix: stream ref for parent

* chore: adjust utilities actions to normalized tables (#1078)

* chore: adjust utilities actions to normalized tables

* chore: reduce database size expectation on test

* chore: update truflation query

* chore: use stream ref

* fix: uuid to int

* chore: register data provider on cache height tracking test

* chore: remove unused local deployer

* chore: remove unused local deployer

* feat: add migration scripts for normalization process (#1097)

* feat: add migration scripts for normalization process

- Introduced multiple SQL migration scripts to transition the database schema from UUID to INT types for IDs.
- Implemented actions to handle both old and new schemas during the migration.
- Added scripts to populate `data_provider_id` and `id` columns in the `streams` table.
- Created necessary indexes and constraints to optimize performance and maintain data integrity.
- Included a shell script for executing migrations and logging execution times.
- Documented the migration process and performance recommendations in the README.

* chore: remove optimized index for gap-filling queries in primitive_events table

* refactor: streamline SQL migration script for foreign key constraints

- Added unique index on streams.id to ensure data integrity before creating foreign key references.
- Simplified the addition of foreign key constraints for metadata and taxonomies tables.
- Removed commented-out code related to partial indexes for primitive_events, as it is not currently supported.

* fix: taxonomy test

---------

Co-authored-by: Raffael Campos <raffael.rcampos@gmail.com>
MicBun added a commit that referenced this pull request Aug 19, 2025
* chore: add data providers table

* feat: add data_providers table

* chore: add unique index

* chore: create index if not exists

* chore: normalize streams table (#1046)

* chore: normalize metadata table (#1047)

* chore: normalize taxonomies table (#1053)

* chore: normalize primitive events table (#1054)

* chore: adjust insert actions to normalized tables

* chore: revise error message

* feat: create action for data provider and test

* chore: adjust insert metadata

* feat: adjust insert primitive events

* chore: adjust tests

* chore: adjust tn ops tests

* chore: adjust tests

* chore: optimize stream ids lookup

* fix: variable name

* chore: use inner join

* chore: remove unnecessary select

* chore: use optimized action on truflation query too

* chore: adjust common actions to normalized tables (#1068)

* chore: adjust common actions to normalized tables

* fix: join data providers

* chore: debug

* chore: adjust authorization actions to normalized tables (#1070)

* chore: adjust authorization actions to normalized tables

* chore: update actions

* chore: update actions

* fix: logic

* chore: adjust taxonomy actions to normalized tables (#1074)

* chore: adjust taxonomy actions to normalized tables

* chore: avoid rate limiting on github actions

* chore: adjust primitive query actions to normalized tables (#1075)

* chore: adjust composed query actions to normalized tables (#1076)

* chore: adjust composed query actions to normalized tables

* chore: update derivates

* fix: stream ref for parent

* chore: adjust utilities actions to normalized tables (#1078)

* chore: adjust utilities actions to normalized tables

* chore: reduce database size expectation on test

* chore: update truflation query

* chore: use stream ref

* fix: uuid to int

* chore: register data provider on cache height tracking test

* chore: remove unused local deployer

* chore: remove unused local deployer

* feat: add migration scripts for normalization process

- Introduced multiple SQL migration scripts to transition the database schema from UUID to INT types for IDs.
- Implemented actions to handle both old and new schemas during the migration.
- Added scripts to populate `data_provider_id` and `id` columns in the `streams` table.
- Created necessary indexes and constraints to optimize performance and maintain data integrity.
- Included a shell script for executing migrations and logging execution times.
- Documented the migration process and performance recommendations in the README.

* chore: remove optimized index for gap-filling queries in primitive_events table

* refactor: streamline SQL migration script for foreign key constraints

- Added unique index on streams.id to ensure data integrity before creating foreign key references.
- Simplified the addition of foreign key constraints for metadata and taxonomies tables.
- Removed commented-out code related to partial indexes for primitive_events, as it is not currently supported.

* feat: view list taxonomies by height (#1098)

* feat: view list taxonomies by height

* chore: apply @coderrabit suggestion

* feat: register deployer as a data provider in benchmark setup

- Added functionality to register the deployer as a data provider during the benchmark setup process.
- Included error handling to wrap any issues encountered while creating the data provider.

* chore: remove unused SQL migration scripts for weight and composed data retrieval

- Deleted the SQL files `get-all-weights.sql` and `get-composed-data.sql` as they are no longer needed in the migration process.
- These scripts were previously used for retrieving weights and composed data from taxonomies but have been deemed obsolete.

* chore: remove obsolete SQL migration scripts for normalization process

- Deleted multiple SQL migration scripts related to the normalization process, including those for structure migration, data population, and final indexing.
- These scripts were previously used to transition the database schema and have been deemed unnecessary after the migration completion.
- The removal helps to clean up the codebase and reduce clutter in the migration directory.

* refactor: normalize SQL migration scripts and clean up legacy columns

- Updated SQL migration scripts to normalize references and improve data integrity.
- Removed denormalized columns from `metadata`, `taxonomies`, and `primitive_events` tables.
- Adjusted primary keys and added necessary indexes to optimize performance.
- Cleaned up the migration directory by removing obsolete scripts and ensuring a streamlined structure.

* chore: remove obsolete test files for weight and category streams

- Deleted the test files `get_all_weights_for_query_test.go` and `get_category_test.go` as they are no longer needed in the codebase.
- These tests were previously used for validating weight calculations and category stream functionalities but have been deemed unnecessary after recent refactoring and updates.
- The removal helps to clean up the test directory and reduce clutter in the codebase.

* feat: add tests for primitive batch insert alignment and enhance complex composed tests

- Introduced `TestPrimitiveBatchInsertAlignment` to ensure correct mapping of batch insertions across multiple streams, addressing a regression issue with stream alignment.
- Added `testComplexComposedRecordTruflationVariant` to validate the consistency of composed records when using Truflation-prefixed actions, ensuring compatibility with frozen logic.
- Updated existing tests to register data providers consistently across various test cases, improving setup reliability.

---------

Co-authored-by: williamrusdyputra <williamrusdyputra@gmail.com>
Co-authored-by: Michael Buntarman <michaelboentarman@gmail.com>
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.

Problem: composed query actions are not adjusted to normalized tables

2 participants