|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +#include "core/data_type/data_type_uint.h" |
| 19 | + |
| 20 | +#include <typeinfo> |
| 21 | + |
| 22 | +#include "common/exception.h" |
| 23 | +#include "core/column/column_vector.h" |
| 24 | + |
| 25 | +namespace doris { |
| 26 | + |
| 27 | +template <PrimitiveType T> |
| 28 | +const std::string DataTypeUInt<T>::get_family_name() const { |
| 29 | + return type_to_string(T); |
| 30 | +} |
| 31 | + |
| 32 | +template <PrimitiveType T> |
| 33 | +Field DataTypeUInt<T>::get_field(const TExprNode&) const { |
| 34 | + throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, |
| 35 | + "SQL literals are not supported for storage-only type {}", get_name()); |
| 36 | +} |
| 37 | + |
| 38 | +template <PrimitiveType T> |
| 39 | +bool DataTypeUInt<T>::equals(const IDataType& rhs) const { |
| 40 | + return typeid(rhs) == typeid(*this); |
| 41 | +} |
| 42 | + |
| 43 | +template <PrimitiveType T> |
| 44 | +int64_t DataTypeUInt<T>::get_uncompressed_serialized_bytes(const IColumn&, int) const { |
| 45 | + throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, |
| 46 | + "Block serialization is not supported for storage-only type {}", get_name()); |
| 47 | +} |
| 48 | + |
| 49 | +template <PrimitiveType T> |
| 50 | +char* DataTypeUInt<T>::serialize(const IColumn&, char*, int) const { |
| 51 | + throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, |
| 52 | + "Block serialization is not supported for storage-only type {}", get_name()); |
| 53 | +} |
| 54 | + |
| 55 | +template <PrimitiveType T> |
| 56 | +const char* DataTypeUInt<T>::deserialize(const char*, MutableColumnPtr*, int) const { |
| 57 | + throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, |
| 58 | + "Block deserialization is not supported for storage-only type {}", get_name()); |
| 59 | +} |
| 60 | + |
| 61 | +template <PrimitiveType T> |
| 62 | +MutableColumnPtr DataTypeUInt<T>::create_column() const { |
| 63 | + return ColumnType::create(); |
| 64 | +} |
| 65 | + |
| 66 | +template <PrimitiveType T> |
| 67 | +Status DataTypeUInt<T>::check_column(const IColumn& column) const { |
| 68 | + return check_column_non_nested_type<ColumnType>(column); |
| 69 | +} |
| 70 | + |
| 71 | +template <PrimitiveType T> |
| 72 | +DataTypeSerDeSPtr DataTypeUInt<T>::get_serde(int) const { |
| 73 | + throw Exception(ErrorCode::NOT_IMPLEMENTED_ERROR, |
| 74 | + "SerDe is not supported for storage-only type {}", get_name()); |
| 75 | +} |
| 76 | + |
| 77 | +template class DataTypeUInt<TYPE_UINT32>; |
| 78 | +template class DataTypeUInt<TYPE_UINT64>; |
| 79 | + |
| 80 | +} // namespace doris |
0 commit comments