Skip to content

fix: fix sql order#94

Merged
zitsen merged 3 commits into
mainfrom
fix/TD-38719
Nov 25, 2025
Merged

fix: fix sql order#94
zitsen merged 3 commits into
mainfrom
fix/TD-38719

Conversation

@qevolg

@qevolg qevolg commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Description

Fix sql order

Jira: https://jira.taosdata.com:18080/browse/TD-38719

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @qevolg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves an issue with SQL query result ordering, particularly focusing on ensuring correct sequence for timestamp columns. The core fix involves a change in how data rows are retrieved internally, complemented by a new test case to rigorously validate the timestamp ordering functionality. Additionally, the PR includes general code cleanup and formatting improvements to enhance overall code quality.

Highlights

  • Corrected SQL Row Retrieval Order: The internal mechanism for retrieving rows from query results has been updated by changing data.pop() to data.shift() in WSRows. This ensures that rows are processed in the correct sequential order, directly addressing the SQL ordering fix.
  • Added Timestamp Ordering Test: A new dedicated test case has been introduced in sql.test.ts to specifically validate the ORDER BY ts ASC/DESC functionality, confirming that timestamp-based ordering in SQL queries now works as expected.
  • Code Cleanup and Readability Improvements: Various minor refactorings have been applied across the codebase, including the removal of unused imports, commented-out code, and adjustments to string concatenation and method spacing for enhanced readability and maintainability.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request primarily addresses a bug in SQL query result ordering by switching from Array.prototype.pop() to Array.prototype.shift() for row retrieval. This ensures that results are processed in the correct First-In, First-Out order. To validate this fix, a new test case has been added, which is a great practice. The remainder of the changes involve general code cleanup, such as removing unused imports, deleting commented-out code, and applying consistent formatting across several files. My review includes a few suggestions to enhance code readability and maintainability by using template literals and refactoring duplicated test logic.

Comment thread nodejs/example/all_type_query.ts
Comment thread nodejs/src/client/wsConnector.ts
Comment thread nodejs/src/client/wsConnectorPool.ts
Comment thread nodejs/src/sql/wsRows.ts
Comment thread nodejs/test/bulkPulling/sql.test.ts
Comment thread nodejs/src/sql/wsRows.ts
Comment thread nodejs/test/bulkPulling/sql.test.ts
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.59%. Comparing base (be06771) to head (3c767d5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #94   +/-   ##
=======================================
  Coverage   80.59%   80.59%           
=======================================
  Files          30       30           
  Lines        2422     2422           
  Branches      415      415           
=======================================
  Hits         1952     1952           
  Misses        364      364           
  Partials      106      106           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zitsen zitsen merged commit b36d1e6 into main Nov 25, 2025
2 checks passed
@zitsen zitsen deleted the fix/TD-38719 branch November 25, 2025 08:57
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.

4 participants