uros-db commented on code in PR #55631:
URL: https://github.com/apache/spark/pull/55631#discussion_r3200775891


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -666,6 +666,14 @@ private[sql] object QueryExecutionErrors extends 
QueryErrorsBase with ExecutionE
       summary = "")
   }
 
+  def stInvalidArgumentErrorInvalidEndiannessValue(
+      sqlFunction: String, endianness: String): SparkIllegalArgumentException 
= {
+    new SparkIllegalArgumentException(
+      errorClass = "ST_INVALID_ARGUMENT.INVALID_ENDIANNESS_VALUE",
+      messageParameters = Map("sqlFunction" -> sqlFunction, "e" -> endianness)

Review Comment:
   Updated to `endianness`.



##########
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/util/Geography.java:
##########
@@ -130,8 +130,14 @@ public static Geography fromEwkt(byte[] ewkt) {
   /** Geography binary standard format converters: WKB and EWKB. */
 
   @Override
-  public byte[] toWkb() {
-    return toWkbInternal(DEFAULT_ENDIANNESS);
+  public byte[] toWkb(String endianness) {
+    // Check the endianness value.
+    if (!endianness.equalsIgnoreCase("NDR") && 
!endianness.equalsIgnoreCase("XDR")) {
+      throw QueryExecutionErrors.stInvalidArgumentErrorInvalidEndiannessValue(
+          "st_asbinary", endianness);

Review Comment:
   Makes sense, updated.



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