[ 
https://issues.apache.org/jira/browse/ARROW-14332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17465524#comment-17465524
 ] 

Eduardo Ponce edited comment on ARROW-14332 at 12/27/21, 4:50 AM:
------------------------------------------------------------------

This table shows Arrow datatypes and corresponding *is_xxx_type* type traits.
||Datatype||Current type trait||
|FixedWidthType| |
|PrimitiveCType|is_primitive_ctype|
|NumberType|is_number_type|
|IntegerType|is_integer_type|
| |is_signed_integer_type|
| |is_unsigned_integer_type|
|[U]Int[8,16,32,64]Type| |
|FloatingPointType|is_floating_type|
|HalfFloatType|is_half_float_type|
|FloatType| |
|DoubleType| |
|ParametricType| |
|NestedType|is_nested_type|
|NullType|is_null_type|
|BooleanType|is_boolean_type|
|BaseBinaryType|is_base_binary_type|
|BinaryType|is_binary_type|
|LargeBinaryType| |
|StringType|is_string_type|
|LargeStringType| |
|FixedSizeBinaryType|is_fixed_size_binary_type|
|DecimalType|is_decimal_type|
|Decimal128Type|is_decimal128_type|
|Decimal256Type|is_decimal256_type|
|BaseListType|is_var_length_list_type|
|ListType|is_list_type|
|LargeListType| |
|FixedSizeListType|is_fixed_size_list_type|
|MapType| |
|StructType|is_struct_type|
|UnionType|is_union_type|
|SparseUnionType| |
|DenseUnionType| |
|TemporalType|is_temporal_type|
|DateType|is_date_type|
|Date64Type| |
|TimeType|is_time_type|
|Time32Type| |
|Time64Type| |
|TimestampType|is_timestamp_type|
|IntervalType|is_interval_type|
|MonthIntervalType| |
|DayTimeIntervalType| |
|MonthDayNanoIntervalType| |
|DurationType|is_duration_type|
|DictionaryType|is_dictionary_type|
|ExtensionType|is_extension_type|

These are special type traits:
 * {{is_string_like_type = is_base_binary_type && T::is_utf8}}
a. (Eduardo) Seems like a semantic duplicate of {{is_string_type}}
 * {{is_binary_like_type = (is_base_binary_type && !is_string_like_type) || 
is_fixed_size_binary_type}}
 * {{is_base_list_type}} deprecated for {{is_var_length_list_type}}
 * {{is_list_like_type = is_base_list_type || is_fixed_size_list_type}}


was (Author: edponce):
This table shows Arrow datatypes and corresponding *is_xxx_type* type traits.
||Datatype||Current type trait||
|FixedWidthType| |
|PrimitiveCType|is_primitive_ctype|
|NumberType|is_number_type|
|IntegerType|is_integer_type|
| |is_signed_integer_type|
| |is_unsigned_integer_type|
|[U]Int[8,16,32,64]Type| |
|FloatingPointType|is_floating_type|
|HalfFloatType|is_half_float_type|
|FloatType| |
|DoubleType| |
|ParametricType| |
|NestedType|is_nested_type|
|NullType|is_null_type|
|BooleanType|is_boolean_type|
|BaseBinaryType|is_base_binary_type|
|BinaryType|is_binary_type|
|LargeBinaryType| |
|StringType|is_string_type|
|LargeStringType| |
|FixedSizeBinaryType|is_fixed_size_binary_type|
| |is_binary_like_type|
|DecimalType|is_decimal_type|
|Decimal128Type|is_decimal128_type|
|Decimal256Type|is_decimal256_type|
|BaseListType|is_var_length_list_type|
|ListType|is_list_type|
|LargeListType| |
|FixedSizeListType|is_fixed_size_list_type|
|MapType| |
|StructType|is_struct_type|
|UnionType|is_union_type|
|SparseUnionType| |
|DenseUnionType| |
|TemporalType|is_temporal_type|
|DateType|is_date_type|
|Date64Type| |
|TimeType|is_time_type|
|Time32Type| |
|Time64Type| |
|TimestampType|is_timestamp_type|
|IntervalType|is_interval_type|
|MonthIntervalType| |
|DayTimeIntervalType| |
|MonthDayNanoIntervalType| |
|DurationType|is_duration_type|
|DictionaryType|is_dictionary_type|
|ExtensionType|is_extension_type|

These are special type traits:
 * {{is_string_like_type = is_base_binary_type && T::is_utf8}}
a. (Eduardo) Seems like a semantic duplicate of {{is_string_type}}
 * {{is_binary_like_type = (is_base_binary_type && !is_string_like_type) || 
is_fixed_size_binary_type}}
 * {{is_base_list_type}} deprecated for {{is_var_length_list_type}}
 * {{is_list_like_type = is_base_list_type || is_fixed_size_list_type}}

> [C++] Rename type traits utilities to improve semantic consistency
> ------------------------------------------------------------------
>
>                 Key: ARROW-14332
>                 URL: https://issues.apache.org/jira/browse/ARROW-14332
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Eduardo Ponce
>            Assignee: Eduardo Ponce
>            Priority: Minor
>              Labels: type
>             Fix For: 8.0.0
>
>
> There are semantic differences between *enable_ifs-related* utils and 
> *is_xxx* functions with the same name. For example, *is_binary_like* 
> [here|https://github.com/apache/arrow/blob/master/cpp/src/arrow/type_traits.h#L596]
>  != 
> [here|https://github.com/apache/arrow/blob/master/cpp/src/arrow/type_traits.h#L924].
>  The former includes binary only and the latter binary/string types.
> Also, the *_like* suffix seems unwarranted as they always refer to binary or 
> string.
> Also, the *is_fixed_size_binary* includes both _FixedSizeBinaryType_ and 
> {_}DecimalXXXType{_}. A better name is *is_base_fixed_size_binary* to match 
> how binary/string utils are used.
> {_}Note{_}: There might be other inconsistencies.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to