AshinGau commented on code in PR #12833:
URL: https://github.com/apache/doris/pull/12833#discussion_r976572752


##########
be/src/vec/exec/format/parquet/schema_desc.cpp:
##########
@@ -150,6 +152,70 @@ void FieldDescriptor::parse_physical_field(const 
tparquet::SchemaElement& physic
     physical_field->physical_type = physical_schema.type;
     _physical_fields.push_back(physical_field);
     physical_field->physical_column_index = _physical_fields.size() - 1;
+    if (physical_schema.__isset.logicalType) {
+        physical_field->type = 
convert_to_doris_type(physical_schema.logicalType);
+    } else if (physical_schema.__isset.converted_type) {
+        physical_field->type = 
convert_to_doris_type(physical_schema.converted_type);
+    }
+}
+
+TypeDescriptor FieldDescriptor::convert_to_doris_type(tparquet::LogicalType 
logicalType) {
+    TypeDescriptor type;
+    if (logicalType.__isset.STRING) {
+        // TODO: len?
+        type.type = TYPE_STRING;
+    } else if (logicalType.__isset.DECIMAL) {
+        type.type = TYPE_DECIMALV2;
+        type.precision = logicalType.DECIMAL.precision;
+        type.scale = logicalType.DECIMAL.scale;
+    } else if (logicalType.__isset.DATE) {
+        type.type = TYPE_DATE;
+    } else if (logicalType.__isset.INTEGER) {
+        type.type = TYPE_INT;

Review Comment:
   parquet `IntType` has `bitWidth` and `isSigned`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to