Github user jinfengni commented on a diff in the pull request:
https://github.com/apache/drill/pull/560#discussion_r85989838
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/interpreter/InterpreterEvaluator.java
---
@@ -378,8 +388,14 @@ public ValueHolder
visitDoubleConstant(ValueExpressions.DoubleExpression dExpr,
}
@Override
- public ValueHolder
visitQuotedStringConstant(ValueExpressions.QuotedString e, Integer value)
throws RuntimeException {
- return
ValueHolderHelper.getVarCharHolder(getManagedBufferIfAvailable(), e.value);
+ public ValueHolder visitQuotedStringConstant(final
ValueExpressions.QuotedString e, Integer value) throws RuntimeException {
+ return getConstantValueHolder(e.value, new Function<DrillBuf,
ValueHolder>() {
--- End diff --
@arina-ielchiieva , I'm not sure if the change makes sense or not.
1. If I have a decimal value, decVal. Let's say
decVal.getBigDecimal().toString() return '123'. When I call
ValueHolderHelper.getDecimal38Holder(buffer,
decExpr.getBigDecimal().toString()), I should return a decimal holder.
2. Now, let's say I have a QuotedString '123', I call
ValueHolderHelper.getVarCharHolder(buffer, e.value), since the key e.value is
same as '123', and the constant value cache will just return the decimal
holder, while I should get a VarcharHolder in stead. Will it cause problem
here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---