github-actions[bot] commented on code in PR #16818:
URL: https://github.com/apache/doris/pull/16818#discussion_r1109553766


##########
be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp:
##########
@@ -0,0 +1,531 @@
+// 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.
+
+#pragma once
+
+#include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/data_types/data_type_nullable.h"
+
+namespace doris::vectorized {
+
+template <typename T>
+class FixLengthDictDecoder final : public BaseDictDecoder {
+public:
+    FixLengthDictDecoder(tparquet::Type::type physical_type)
+            : BaseDictDecoder(), _physical_type(physical_type) {};
+    ~FixLengthDictDecoder() override = default;
+
+    Status decode_values(MutableColumnPtr& doris_column, DataTypePtr& 
data_type,
+                         ColumnSelectVector& select_vector) override {
+        size_t non_null_size = select_vector.num_values() - 
select_vector.num_nulls();
+        if (doris_column->is_column_dictionary() &&
+            assert_cast<ColumnDictI32&>(*doris_column).dict_size() == 0) {
+            std::vector<StringRef> dict_items;
+            dict_items.reserve(_dict_items.size());
+            for (int i = 0; i < _dict_items.size(); ++i) {
+                dict_items.emplace_back((char*)(&_dict_items[i]), 
_type_length);
+            }
+            assert_cast<ColumnDictI32&>(*doris_column)
+                    .insert_many_dict_data(&dict_items[0], dict_items.size());
+        }
+        _indexes.resize(non_null_size);
+        _index_batch_decoder->GetBatch(&_indexes[0], non_null_size);
+
+        if (doris_column->is_column_dictionary()) {
+            return _decode_dict_values(doris_column, select_vector);
+        }
+
+        TypeIndex logical_type = remove_nullable(data_type)->get_type_id();
+        switch (logical_type) {
+#define DISPATCH(NUMERIC_TYPE, CPP_NUMERIC_TYPE, PHYSICAL_TYPE)                
    \
+    case NUMERIC_TYPE:                                                         
    \
+        if constexpr (std::is_same_v<T, PHYSICAL_TYPE>) {                      
    \
+            return _decode_numeric<CPP_NUMERIC_TYPE>(doris_column, 
select_vector); \
+        }
+            FOR_LOGICAL_NUMERIC_TYPES(DISPATCH)

Review Comment:
   warning: use of undeclared identifier 'DISPATCH' [clang-diagnostic-error]
   ```cpp
               FOR_LOGICAL_NUMERIC_TYPES(DISPATCH)
                                         ^
   ```
   



##########
be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp:
##########
@@ -0,0 +1,531 @@
+// 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.
+
+#pragma once
+
+#include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/data_types/data_type_nullable.h"
+
+namespace doris::vectorized {
+
+template <typename T>
+class FixLengthDictDecoder final : public BaseDictDecoder {
+public:
+    FixLengthDictDecoder(tparquet::Type::type physical_type)
+            : BaseDictDecoder(), _physical_type(physical_type) {};
+    ~FixLengthDictDecoder() override = default;
+
+    Status decode_values(MutableColumnPtr& doris_column, DataTypePtr& 
data_type,
+                         ColumnSelectVector& select_vector) override {
+        size_t non_null_size = select_vector.num_values() - 
select_vector.num_nulls();
+        if (doris_column->is_column_dictionary() &&
+            assert_cast<ColumnDictI32&>(*doris_column).dict_size() == 0) {
+            std::vector<StringRef> dict_items;
+            dict_items.reserve(_dict_items.size());
+            for (int i = 0; i < _dict_items.size(); ++i) {
+                dict_items.emplace_back((char*)(&_dict_items[i]), 
_type_length);
+            }
+            assert_cast<ColumnDictI32&>(*doris_column)
+                    .insert_many_dict_data(&dict_items[0], dict_items.size());
+        }
+        _indexes.resize(non_null_size);
+        _index_batch_decoder->GetBatch(&_indexes[0], non_null_size);

Review Comment:
   warning: use of undeclared identifier '_indexes' [clang-diagnostic-error]
   ```cpp
           _index_batch_decoder->GetBatch(&_indexes[0], non_null_size);
                                           ^
   ```
   



##########
be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp:
##########
@@ -0,0 +1,531 @@
+// 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.
+
+#pragma once
+
+#include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/data_types/data_type_nullable.h"
+
+namespace doris::vectorized {
+
+template <typename T>
+class FixLengthDictDecoder final : public BaseDictDecoder {
+public:
+    FixLengthDictDecoder(tparquet::Type::type physical_type)
+            : BaseDictDecoder(), _physical_type(physical_type) {};
+    ~FixLengthDictDecoder() override = default;
+
+    Status decode_values(MutableColumnPtr& doris_column, DataTypePtr& 
data_type,
+                         ColumnSelectVector& select_vector) override {
+        size_t non_null_size = select_vector.num_values() - 
select_vector.num_nulls();
+        if (doris_column->is_column_dictionary() &&
+            assert_cast<ColumnDictI32&>(*doris_column).dict_size() == 0) {
+            std::vector<StringRef> dict_items;
+            dict_items.reserve(_dict_items.size());
+            for (int i = 0; i < _dict_items.size(); ++i) {
+                dict_items.emplace_back((char*)(&_dict_items[i]), 
_type_length);
+            }
+            assert_cast<ColumnDictI32&>(*doris_column)
+                    .insert_many_dict_data(&dict_items[0], dict_items.size());
+        }
+        _indexes.resize(non_null_size);
+        _index_batch_decoder->GetBatch(&_indexes[0], non_null_size);
+
+        if (doris_column->is_column_dictionary()) {
+            return _decode_dict_values(doris_column, select_vector);
+        }
+
+        TypeIndex logical_type = remove_nullable(data_type)->get_type_id();
+        switch (logical_type) {
+#define DISPATCH(NUMERIC_TYPE, CPP_NUMERIC_TYPE, PHYSICAL_TYPE)                
    \
+    case NUMERIC_TYPE:                                                         
    \
+        if constexpr (std::is_same_v<T, PHYSICAL_TYPE>) {                      
    \
+            return _decode_numeric<CPP_NUMERIC_TYPE>(doris_column, 
select_vector); \
+        }
+            FOR_LOGICAL_NUMERIC_TYPES(DISPATCH)
+#undef DISPATCH
+        case TypeIndex::Date:
+            if constexpr (std::is_same_v<T, Int32>) {
+                return _decode_date<VecDateTimeValue, Int64>(doris_column, 
select_vector);
+            }
+            break;
+        case TypeIndex::DateV2:
+            if constexpr (std::is_same_v<T, Int32>) {
+                return _decode_date<DateV2Value<DateV2ValueType>, 
UInt32>(doris_column,
+                                                                          
select_vector);
+            }
+            break;
+        case TypeIndex::DateTime:
+            if constexpr (std::is_same_v<T, ParquetInt96>) {

Review Comment:
   warning: use of undeclared identifier 'ParquetInt96' [clang-diagnostic-error]
   ```cpp
               if constexpr (std::is_same_v<T, ParquetInt96>) {
                                               ^
   ```
   



##########
be/src/vec/exec/format/parquet/fix_length_dict_decoder.hpp:
##########
@@ -0,0 +1,531 @@
+// 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.
+
+#pragma once
+
+#include "vec/columns/column_dictionary.h"
+#include "vec/columns/column_nullable.h"
+#include "vec/data_types/data_type_nullable.h"
+
+namespace doris::vectorized {
+
+template <typename T>
+class FixLengthDictDecoder final : public BaseDictDecoder {
+public:
+    FixLengthDictDecoder(tparquet::Type::type physical_type)
+            : BaseDictDecoder(), _physical_type(physical_type) {};
+    ~FixLengthDictDecoder() override = default;
+
+    Status decode_values(MutableColumnPtr& doris_column, DataTypePtr& 
data_type,
+                         ColumnSelectVector& select_vector) override {
+        size_t non_null_size = select_vector.num_values() - 
select_vector.num_nulls();
+        if (doris_column->is_column_dictionary() &&
+            assert_cast<ColumnDictI32&>(*doris_column).dict_size() == 0) {
+            std::vector<StringRef> dict_items;
+            dict_items.reserve(_dict_items.size());
+            for (int i = 0; i < _dict_items.size(); ++i) {
+                dict_items.emplace_back((char*)(&_dict_items[i]), 
_type_length);
+            }
+            assert_cast<ColumnDictI32&>(*doris_column)
+                    .insert_many_dict_data(&dict_items[0], dict_items.size());
+        }
+        _indexes.resize(non_null_size);
+        _index_batch_decoder->GetBatch(&_indexes[0], non_null_size);
+
+        if (doris_column->is_column_dictionary()) {
+            return _decode_dict_values(doris_column, select_vector);
+        }
+
+        TypeIndex logical_type = remove_nullable(data_type)->get_type_id();
+        switch (logical_type) {
+#define DISPATCH(NUMERIC_TYPE, CPP_NUMERIC_TYPE, PHYSICAL_TYPE)                
    \
+    case NUMERIC_TYPE:                                                         
    \
+        if constexpr (std::is_same_v<T, PHYSICAL_TYPE>) {                      
    \
+            return _decode_numeric<CPP_NUMERIC_TYPE>(doris_column, 
select_vector); \
+        }
+            FOR_LOGICAL_NUMERIC_TYPES(DISPATCH)

Review Comment:
   warning: expected ';' after expression [clang-diagnostic-error]
   
   ```suggestion
               FOR_LOGICAL_NUMERIC_TYPES(DISPATCH);
   ```
   



-- 
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...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to