MaxGekk commented on code in PR #37452:
URL: https://github.com/apache/spark/pull/37452#discussion_r942654055
##########
sql/core/src/test/resources/sql-tests/results/ansi/array.sql.out:
##########
@@ -165,10 +165,7 @@ select element_at(array(1, 2, 3), 5)
struct<>
-- !query output
org.apache.spark.SparkArrayIndexOutOfBoundsException
-[INVALID_ARRAY_INDEX_IN_ELEMENT_AT] The index 5 is out of bounds. The array
has 3 elements. Use `try_element_at` to tolerate accessing element at invalid
index and return NULL instead. If necessary set "spark.sql.ansi.enabled" to
"false" to bypass this error.
-== SQL(line 1, position 8) ==
-select element_at(array(1, 2, 3), 5)
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+{"errorClass":"INVALID_ARRAY_INDEX_IN_ELEMENT_AT","messageParameters":["5","3","\"spark.sql.ansi.enabled\""],"queryContext":[{"objectType":"","objectName":"","startIndex":7,"stopIndex":35,"fragment":"element_at(array(1,
2, 3), 5"}]}
Review Comment:
If we put `parameterName` to golden files, we prevent tech writers from
modifying of parameters names in error-classes.json. It seems it is unnecessary
restriction, isn't. In any case, the order of params is fixed/constant in the
code. cc @cloud-fan WDYT?
--
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]