Fix hql rendering for signed numeric literals.

This commit fixes an issue where an extra space is added between the sign and the actual value of signed numerics.

Closes: #3342
Original Pull Request: #3343
This commit is contained in:
Shigeru Hagiwara
2024-02-01 06:30:39 +09:00
committed by Christoph Strobl
parent 8745b46dc7
commit 6f8f63a74a
2 changed files with 6 additions and 1 deletions

View File

@@ -1289,7 +1289,7 @@ class HqlQueryRenderer extends HqlBaseVisitor<List<JpaQueryParsingToken>> {
List<JpaQueryParsingToken> tokens = new ArrayList<>();
tokens.add(new JpaQueryParsingToken(ctx.op));
tokens.add(new JpaQueryParsingToken(ctx.op, false));
tokens.addAll(visit(ctx.numericLiteral()));
return tokens;

View File

@@ -1633,4 +1633,9 @@ class HqlQueryRendererTests {
group by extract(epoch from departureTime)
""");
}
@Test
void queryWithSignedNumericLiteralShouldWork() {
assertQuery("select -1");
}
}