OIiveirra commented on code in PR #71342:
URL: https://github.com/apache/doris/pull/71342#discussion_r4789810979


##########
fe/fe-core/src/main/java/org/apache/doris/arrowflight/FlightSqlQuerySchema.java:
##########
@@ -402,6 +402,20 @@ private static void resolveNamespace(ConnectContext 
context, Plan plan, Map<Stri
      */
     private static Field field(String name, Type type, boolean nullable, 
String timezone)
             throws UndiscoverableSchemaException {
+        // Only top-level default spatial columns have a GeoArrow wire 
representation.
+        if (type instanceof ScalarType && ((ScalarType) type).isSpatialType()) 
{
+            ScalarType spatial = (ScalarType) type;
+            boolean geography = spatial.getPrimitiveType() == 
PrimitiveType.GEOGRAPHY;
+            if (!"OGC:CRS84".equals(spatial.getSpatialCrs())
+                    || (geography && 
!"spherical".equals(spatial.getSpatialAlgorithm()))) {
+                throw new UndiscoverableSchemaException("Unsupported Arrow 
result type: " + type);
+            }
+            String metadata = geography
+                    ? 
"{\"crs\":\"OGC:CRS84\",\"crs_type\":\"authority_code\",\"edges\":\"spherical\"}"
+                    : 
"{\"crs\":\"OGC:CRS84\",\"crs_type\":\"authority_code\"}";
+            return new Field(name, new FieldType(nullable, new 
ArrowType.Binary(), null,

Review Comment:
   Fixed in e51c8558ebe. `GetTables(include_schema=true)` now uses the column’s 
CRS and edge algorithm to publish the same GeoArrow type as `SELECT` for 
supported top-level columns. Verified both paths on the same Iceberg table, 
including plain `VARBINARY` and non-default spatial columns.



##########
be/src/format/arrow/arrow_block_convertor.cpp:
##########
@@ -534,6 +546,19 @@ Status ArrowBlockConvertor::convert_from_arrow(const 
std::shared_ptr<arrow::Reco
     return Status::NotSupported("This Arrow converter does not support 
reading");
 }
 
+std::shared_ptr<arrow::DataType> binary_builder_type(const arrow::Field& field,
+                                                     size_t column_bytes) {
+    if (column_bytes < MAX_ARROW_UTF8) {
+        return field.type();
+    }
+    // Flight SQL publishes geoarrow.wkb with 32-bit offsets for the entire 
stream.
+    const auto& metadata = field.metadata();
+    if (metadata && metadata->Get("ARROW:extension:name").ValueOr("") == 
"geoarrow.wkb") {
+        return field.type();

Review Comment:
   Addressed in 6aae6f7e53f and c2e8da5d07c using the documented-limit option. 
Each GeoArrow column can carry up to 2,147,483,646 non-NULL WKB bytes per 
batch. The writer reports the column and row on overflow. The regression test 
exercises conversion at the limit and rejection of both a single oversized 
value and a cumulative overflow.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to