61yao commented on code in PR #9389: URL: https://github.com/apache/pinot/pull/9389#discussion_r978061799
########## pinot-common/src/main/java/org/apache/pinot/common/request/context/LiteralContext.java: ########## @@ -0,0 +1,126 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.common.request.context; + +import com.google.common.base.Preconditions; +import java.util.Objects; +import javax.annotation.Nullable; +import org.apache.pinot.common.request.Literal; +import org.apache.pinot.spi.data.FieldSpec; + + +/** + * The {@code LiteralContext} class represents a literal in the query. + * <p>This includes both value and type information. We translate thrift literal to this representation in server. + * Currently, only Boolean literal is correctly encoded in thrift and passed in. + * All integers are encoded as LONG in thrift, and the other numerical types are encoded as DOUBLE. + * The remaining types are encoded as STRING. + */ +public class LiteralContext { + // TODO: Support all of the types for sql. + private FieldSpec.DataType _type; + private Object _value; + + private static FieldSpec.DataType convertThriftTypeToDataType(Literal._Fields fields) { + switch (fields) { Review Comment: Now we only have long, double and string and bool thirft type set. I moved int types to unsupported. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org