Merged
Conversation
youngwinds
reviewed
Mar 5, 2026
- 修复 dslToSQL.ts:添加别名到字段的映射逻辑 - 支持 groupBy、orderBy、having 中的别名自动解析为实际字段 - 更新所有 vquery 单元测试快照(30+ 测试) - 更新 demoConnector/localConnector:从 field 读取,映射回 alias 返回 - 所有测试通过:151 passed, 60 test files passed
youngwinds
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
在前面的修复 #361 中,虽然已将所有操作改为使用
field而非alias来作为measure的唯一标识符,但SQL查询结果的列名仍然使用了alias。这导致当两个measures被重命名为相同的alias时,SQL会生成重复的列名,后者覆盖前者,导致两个measure显示相同的数值。解决方案
改用
field而不是alias作为SQL列名,确保唯一性。这样与VSeed层已经使用field作为id保持一致。修改内容
packages/vquery/src/sql-builder/builders/select.ts
field作为SQL别名而非aliaspractices/professional/src/utils/demoConnector.ts
field而不是aliaspractices/professional/src/utils/localConnector.ts
field来读取SQL结果数据