csun5285 commented on code in PR #64128:
URL: https://github.com/apache/doris/pull/64128#discussion_r3410688645


##########
be/src/core/column/column_execute_util.h:
##########
@@ -32,27 +36,55 @@ namespace doris {
 
 // Utility tools for convenient column execution
 
-// ColumnElementView is used to distinguish between scalar columns and string 
columns
+// Per-row read view over a column.  The pointer returned by ptr_at on the
+// string specialization is valid only until the next ptr_at call.
+namespace detail {
+
 template <PrimitiveType PType>
-struct ColumnElementView {
+struct NumericElementView {
     using ColumnType = typename PrimitiveTypeTraits<PType>::ColumnType;
     using ElementType = typename ColumnType::value_type;
     const typename ColumnType::Container& data;
-    ElementType get_element(size_t idx) const { return data[idx]; }
-    const ElementType* get_data() const { return data.data(); }
 
-    ColumnElementView(const IColumn& column)
+    NumericElementView(const IColumn& column)
             : data(assert_cast<const ColumnType&>(column).get_data()) {}
+
+    ElementType get_element(size_t idx) const { return data[idx]; }
+    const ElementType* get_data() const { return data.data(); }
+    ElementType operator[](size_t idx) const { return data[idx]; }
+    const ElementType* ptr_at(size_t idx) const { return data.data() + idx; }
+    size_t size() const { return data.size(); }
 };
 
-template <>
-struct ColumnElementView<TYPE_STRING> {

Review Comment:
   我是想把这两种分开,数值类型的直接在podarray 上就可以取到单个元素,string 还要特殊保存下stringref。



-- 
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]

Reply via email to