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


##########
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; }

Review Comment:
   这个API 可能意义不大,这个已经是view了,如果还返回view的指针,感觉有点绕了



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