Daniel created SPARK-48966:
------------------------------

             Summary: Improve error message with invalid unresolved column 
reference in UDTF call
                 Key: SPARK-48966
                 URL: https://issues.apache.org/jira/browse/SPARK-48966
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 4.0.0
            Reporter: Daniel


This bug covers improving an error message in the event of invalid UDTF calls. 
For example:

{{select * from udtf(}}
{{  observed => TABLE(select column from t),}}
{{  value_col => classic_dollars}}
{{)}}


Currently we get:


{{Unsupported subquery expression: Table arguments are used in a function where 
they are not supported:}}
{{'UnresolvedTableValuedFunction [udtf], [observed => table-argument#68918 [], 
value_col => 'classic_dollars], false}}
{{   +- Project ...}}
{{       +- SubqueryAlias ...}}
{{          +- Relation ...}}


But the real error is that the user passed column identifier classic_dollars 
rather than string "classic_dollars" into the string argument.

The core reason is that {{CheckAnalysis}} checks the analyzer output tree for 
unresolved nodes at the end rather than reporting the error at the time of 
attempted resolving of the corresponding expression or operator (in this case, 
the unresolved attribute reference resulting from the unquoted 
{{{}classic_dollars{}}}).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to