srielau commented on code in PR #56471:
URL: https://github.com/apache/spark/pull/56471#discussion_r3422528549
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/variant/VariantExpressionEvalUtils.scala:
##########
@@ -75,6 +75,36 @@ object VariantExpressionEvalUtils {
def isValidVariant(input: VariantVal): Boolean =
VariantUtil.isValidVariant(input.getValue, input.getMetadata)
+ /** Throws `INVALID_VARIANT_PATH` on a malformed path or on the empty (root
`$`) path. */
+ def parseVariantDeletePath(pathValue: String): Array[VariantPathSegment] = {
+ val parsed = VariantPathParser.parse(pathValue).getOrElse {
+ throw QueryExecutionErrors.invalidVariantPath(pathValue,
"variant_delete")
+ }
+ if (parsed.isEmpty) {
+ throw QueryExecutionErrors.invalidVariantPath(pathValue,
"variant_delete")
Review Comment:
```suggestion
throw QueryExecutionErrors.invalidVariantPath(pathValue,
toSqlId("variant_delete"))
```
--
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]