cloud-fan commented on code in PR #52491:
URL: https://github.com/apache/spark/pull/52491#discussion_r2429354289


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/parser/DataTypeAstBuilder.scala:
##########
@@ -118,6 +118,30 @@ class DataTypeAstBuilder extends 
SqlBaseParserBaseVisitor[AnyRef] {
             currentCtx.precision.getText.toInt
           }
           TimeType(precision)
+        case GEOGRAPHY =>
+          // Unparameterized geometry type isn't supported and will be caught 
by the default branch.
+          // Here, we only handle the parameterized GEOGRAPHY type syntax, 
which comes in two forms:
+          if (currentCtx.srid.getText.toLowerCase(Locale.ROOT) == "any") {
+            // The special parameterized GEOGRAPHY type syntax uses a single 
"ANY" string value.
+            // This implies a mixed GEOGRAPHY type, with potentially different 
SRIDs across rows.
+            GeographyType("ANY")
+          } else {
+            // The explicitly parameterzied GEOGRAPHY syntax uses a specified 
integer SRID value.
+            // This implies a fixed GEOGRAPHY type, with a single fixed SRID 
value across all rows.
+            GeographyType(currentCtx.srid.getText.toInt)
+          }
+        case GEOMETRY =>
+          // Unparameterized geometry type isn't supported and will be caught 
by the default branch.
+          // Here, we only handle the parameterized GEOMETRY type syntax, 
which comes in two forms:
+          if (currentCtx.srid.getText.toLowerCase(Locale.ROOT) == "any") {

Review Comment:
   ```suggestion
             if (currentCtx.srid.ANY() != null) {
   ```



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