You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "Jackie-Jiang (via GitHub)" <gi...@apache.org> on 2024/08/13 21:56:54 UTC

Re: [PR] Fix literal type handling in LiteralValueExtractor [pinot]

Jackie-Jiang commented on code in PR #13715:
URL: https://github.com/apache/pinot/pull/13715#discussion_r1715978481


##########
pinot-core/src/main/java/org/apache/pinot/core/query/reduce/filter/LiteralValueExtractor.java:
##########
@@ -18,31 +18,34 @@
  */
 package org.apache.pinot.core.query.reduce.filter;
 
+import org.apache.pinot.common.request.context.LiteralContext;
 import org.apache.pinot.common.utils.DataSchema.ColumnDataType;
 
 
 /**
  * Value extractor for a literal.
  */
 public class LiteralValueExtractor implements ValueExtractor {
-  private final String _literal;
+  private final LiteralContext _literal;
 
-  public LiteralValueExtractor(String literal) {
+  public LiteralValueExtractor(LiteralContext literal) {
     _literal = literal;
   }
 
   @Override
   public String getColumnName() {
-    return '\'' + _literal + '\'';
+    return '\'' + _literal.getStringValue() + '\'';

Review Comment:
   Consider directly return `_literal` because `_literal.toString()` handles array types properly



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org