Copilot commented on code in PR #50807:
URL: https://github.com/apache/arrow/pull/50807#discussion_r3902641941


##########
cpp/src/parquet/schema.cc:
##########
@@ -620,6 +621,11 @@ void ToParquet(const GroupNode* schema, 
std::vector<format::SchemaElement>* out)
   schema->VisitConst(&visitor);
 }
 
+bool IsFloatingPointType(const ColumnDescriptor& descr) {
+  return descr.physical_type() == Type::FLOAT || descr.physical_type() == 
Type::DOUBLE ||
+         descr.logical_type()->type() == LogicalType::Type::FLOAT16;
+}

Review Comment:
   `IsFloatingPointType` unconditionally dereferences `descr.logical_type()`, 
but `ColumnDescriptor::logical_type()` can be null for many primitive nodes 
created with only a physical/converted type (e.g. `schema::Float(...)`). This 
can crash when called from the page index builder / metadata column order init. 
Guard the pointer before accessing `->type()`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to