OIiveirra commented on code in PR #69032:
URL: https://github.com/apache/doris/pull/69032#discussion_r4273977270
##########
be/src/format_v2/parquet/native_schema_desc.cpp:
##########
@@ -844,8 +845,19 @@ std::pair<DataTypePtr, bool>
NativeFieldDescriptor::convert_to_doris_type(
tparquet::LogicalType logicalType, bool nullable) {
std::pair<DataTypePtr, bool> ans = {std::make_shared<DataTypeNothing>(),
false};
bool& is_type_compatibility = ans.second;
- if (logicalType.__isset.STRING || logicalType.__isset.ENUM ||
logicalType.__isset.JSON ||
- logicalType.__isset.BSON) {
+ if (logicalType.__isset.GEOMETRY) {
+ const std::string crs =
+ logicalType.GEOMETRY.__isset.crs ? logicalType.GEOMETRY.crs :
"OGC:CRS84";
+ ans.first = std::make_shared<DataTypeSpatial>(TYPE_GEOMETRY, crs);
Review Comment:
Fixed in
[c844f46f09f](https://github.com/apache/doris/commit/c844f46f09f64eaacd68688876227eb877c0f1db).
Both v1 and v2 spatial schema converters now honor `nullable` for GEOMETRY
and GEOGRAPHY. The schema UT checks REQUIRED/OPTIONAL types and the native
COUNT definition-level threshold. The Iceberg regression uses actual OPTIONAL
spatial files and checks both kinds with both scanner versions and COUNT
pushdown enabled/disabled; all eight results match the non-null row counts. The
targeted BE tests and the complete Iceberg spatial suite passed locally.
##########
fe/fe-type/src/main/java/org/apache/doris/catalog/PrimitiveType.java:
##########
@@ -83,7 +83,9 @@ public enum PrimitiveType {
VARIANT("VARIANT", 24, TPrimitiveType.VARIANT, false),
TEMPLATE("TEMPLATE", -1, TPrimitiveType.INVALID_TYPE, false),
// Unsupported scalar types.
- BINARY("BINARY", -1, TPrimitiveType.BINARY, false);
+ BINARY("BINARY", -1, TPrimitiveType.BINARY, false),
+ GEOMETRY("GEOMETRY", 16, TPrimitiveType.GEOMETRY, false),
Review Comment:
Fixed in
[c844f46f09f](https://github.com/apache/doris/commit/c844f46f09f64eaacd68688876227eb877c0f1db).
GEOMETRY and GEOGRAPHY now use the existing VARBINARY MySQL metadata
contract: MYSQL_TYPE_VARSTRING, charset 63 and BINARY_FLAG. Added direct packet
metadata coverage for both kinds. Default Unicode PyMySQL also returns the
exact WKB bytes for both typed constructors and their ST_AsBinary projections
(4/4 local checks), without a hex projection.
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -5391,6 +5382,21 @@ public DataType
visitAggStateDataType(AggStateDataTypeContext ctx) {
});
}
+ @Override
+ public DataType visitSpatialDataType(SpatialDataTypeContext ctx) {
+ return ParserUtils.withOrigin(ctx, () -> {
+ String crs = ctx.crs == null ? "OGC:CRS84" :
stripQuotes(ctx.crs.getText());
Review Comment:
Fixed in
[c844f46f09f](https://github.com/apache/doris/commit/c844f46f09f64eaacd68688876227eb877c0f1db).
Spatial CRS/algorithm literals now use SqlLiteralUtils.parseStringLiteral.
ScalarType.toSql escapes both apostrophes and backslashes so rendering and
reparsing preserve the parameter identity. Added Geometry and Geography
round-trip tests for escaped CRS strings; the targeted FE tests passed locally.
--
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]