-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-22480 Sql. Avoid compiling literal-only expressions when assembling a row for insert #3922
Conversation
Object val = literal.getValueAs(type); | ||
|
||
// Literal was parsed as UTC timestamp, now we need to adjust it to the client's time zone. | ||
if (val != null && literal.getTypeName() == SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we adjust TIME_WITH_LOCAL_TIME_ZONE
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have separate ticket for this https://issues.apache.org/jira/browse/IGNITE-21555
@@ -704,8 +701,36 @@ public void testRowSource() { | |||
RexNode val10 = rexBuilder.makeExactLiteral(new BigDecimal("1"), intType); | |||
RexNode val11 = rexBuilder.makeExactLiteral(new BigDecimal("2"), bigIntType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think we need to ensure that DECIMAL values preserve precision/scale after this transformation.
- Ideally, we need to check literals of all types here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the test has been improved, please take a look again.
// Avoiding compilation when all expressions are constants. | ||
for (int i = 0; i < values.size(); i++) { | ||
if (!(values.get(i) instanceof RexLiteral)) { | ||
return new ValuesImpl(scalar(values, null), ctx.rowHandler().factory(rowSchema)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factory could be cached in local variable.
https://issues.apache.org/jira/browse/IGNITE-22480