PARQUET-1180: Fix behaviour of num_children element of primitive nodes
Per the parquet.thift spec, for primitive nodes the num_children schema
attibute should remain unset. This is implemeted correctly in parquet-mr
see [1]. However currently parquet-cpp does set the num_children
attribute to 0 if it is a primitive node. This pull requests fixes this
issue and the tests that were relying on this behavior
[1] parquet-mr/parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
Author: Alec Posney <aposney@atlassian.com>
Closes #427 from Posnet/fix-primite-node-num-children and squashes the following commits:
e5af5c6 [Alec Posney] Fix behavior of num_children element of primitive nodes
diff --git a/src/parquet/schema-test.cc b/src/parquet/schema-test.cc
index f806c12..c8cce9f 100644
--- a/src/parquet/schema-test.cc
+++ b/src/parquet/schema-test.cc
@@ -47,7 +47,6 @@
result.__set_name(name);
result.__set_repetition_type(repetition);
result.__set_type(type);
- result.__set_num_children(0);
return result;
}
diff --git a/src/parquet/schema.cc b/src/parquet/schema.cc
index fa6116f..6075ab6 100644
--- a/src/parquet/schema.cc
+++ b/src/parquet/schema.cc
@@ -350,7 +350,6 @@
format::SchemaElement* element = static_cast<format::SchemaElement*>(opaque_element);
element->__set_name(name_);
- element->__set_num_children(0);
element->__set_repetition_type(ToThrift(repetition_));
if (logical_type_ != LogicalType::NONE) {
element->__set_converted_type(ToThrift(logical_type_));