amorynan commented on code in PR #32620:
URL: https://github.com/apache/doris/pull/32620#discussion_r1581998998
##########
be/src/olap/rowset/segment_v2/inverted_index_reader.h:
##########
@@ -279,6 +280,93 @@ class BkdIndexReader : public InvertedIndexReader {
const KeyCoder* _value_key_coder {};
};
+/**
+ * @brief InvertedIndexQueryParamFactory is a factory class to create
QueryValue object.
+ * we need a template function to make predict class like in_list_predict
template class to use.
+ * also need a function with primitive type parameter to create inverted index
query value. like some function expr: function_array_index
+ * Now we just mapping field value in query engine to storage field value
+ */
+class InvertedIndexQueryParamFactory {
+ ENABLE_FACTORY_CREATOR(InvertedIndexQueryParamFactory);
+
+public:
+ virtual ~InvertedIndexQueryParamFactory() = default;
+
+ template <PrimitiveType PT>
+ static Status create_query_value(const void* value,
+
std::unique_ptr<InvertedIndexQueryParamFactory>& result_param);
+
+ static Status create_query_value(
+ const PrimitiveType& primitiveType, const void* value,
+ std::unique_ptr<InvertedIndexQueryParamFactory>& result_param) {
+ switch (primitiveType) {
+ case PrimitiveType::TYPE_BOOLEAN:
+ return create_query_value<TYPE_BOOLEAN>(value, result_param);
+ case PrimitiveType::TYPE_TINYINT:
+ return create_query_value<TYPE_TINYINT>(value, result_param);
+ case PrimitiveType::TYPE_SMALLINT:
+ return create_query_value<TYPE_SMALLINT>(value, result_param);
+ case PrimitiveType::TYPE_INT:
+ return create_query_value<TYPE_INT>(value, result_param);
Review Comment:
done!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]