Symptom
When an ORDER BY identifier collides with a table alias — e.g.
SELECT e.name FROM emp e ORDER BY e
GenericIdentifier.update (sql/src/main/scala/app/softnetwork/elastic/sql/package.scala, alias-split logic ~L1224-1234) splits the identifier into name = "" and tableAlias = Some("e"). The reconstructed SQL then contains a dangling qualifier (ORDER BY e.); before the #158 fix it rendered ORDER BY ASC (empty name). Either way the statement is silently malformed instead of being rejected.
Scope
Proposed fix
Reject the split in GenericIdentifier.update when the remaining column name is empty (validation error such as "Column name expected after table alias 'e'"), instead of manufacturing an empty identifier.
References
Symptom
When an ORDER BY identifier collides with a table alias — e.g.
GenericIdentifier.update(sql/src/main/scala/app/softnetwork/elastic/sql/package.scala, alias-split logic ~L1224-1234) splits the identifier intoname = ""andtableAlias = Some("e"). The reconstructed SQL then contains a dangling qualifier (ORDER BY e.); before the #158 fix it renderedORDER BY ASC(empty name). Either way the statement is silently malformed instead of being rejected.Scope
Proposed fix
Reject the split in
GenericIdentifier.updatewhen the remaining column name is empty (validation error such as "Column name expected after table alias 'e'"), instead of manufacturing an empty identifier.References
_bmad-output/implementation-artifacts/bug-158-repl-join-order-by-qualifier.md, Review Findings)