pitrou commented on a change in pull request #6213:
URL: https://github.com/apache/arrow/pull/6213#discussion_r442423611
##########
File path: cpp/src/arrow/type.cc
##########
@@ -501,20 +501,35 @@ Status Decimal128Type::Make(int32_t precision, int32_t
scale,
// ----------------------------------------------------------------------
// Dictionary-encoded type
+Status DictionaryType::ValidateParameters(const DataType& index_type,
+ const DataType& value_type) {
+ const bool index_type_ok = is_integer(index_type.id()) &&
+ checked_cast<const
IntegerType&>(index_type).is_signed();
+ if (!index_type_ok) {
+ return Status::TypeError("Dictionary index type should be signed integer,
got ",
Review comment:
I'm not sure about the history (@wesm could tell more), but it's
specified here:
https://arrow.apache.org/docs/format/Columnar.html#dictionary-encoded-layout
> When a field is dictionary encoded, the values are represented by an array
of signed integers representing the index of the value in the dictionary.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]