[ 
https://issues.apache.org/jira/browse/SPARK-52148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Allison Wang updated SPARK-52148:
---------------------------------
    Description: 
CREATE OR REPLACE FUNCTION foo3_3at(x INT) RETURNS TABLE (a DOUBLE) RETURN 
SELECT 1 / x
 
 
CREATE OR REPLACE FUNCTION foo3_3at(x INT) RETURNS TABLE (a DOUBLE) RETURN 
SELECT 1 / x
 
 
-- !query schema
 
 
-- !query schema
 
 
struct<>
 
 
struct<>
 
 
-- !query output
 
 
-- !query output
Text moved with changes to lines 4840-4849 (97.4% similarity)
 
 
 
org.apache.spark.sql.catalyst.analysis.FunctionAlreadyExistsException
 
 
 
 
 
{
 
 
 
 
 
 "errorClass" : "ROUTINE_ALREADY_EXISTS",
 
 
 
 
 
 "sqlState" : "42723",
 
 
 
 
 
 "messageParameters" : {
 
 
 
 
 
 "existingRoutineType" : "routine",
 
 
 
 
 
 "newRoutineType" : "routine",
 
 
 
 
 
 "routineName" : "`default`.`foo3_3at`"
 
 
 
 
 
 }
 
 
 
 
 
}

  was:
This should work:

-- !query
CREATE OR REPLACE FUNCTION foo3_3a(x INT) RETURNS DOUBLE RETURN 1 / x
-- !query schema
struct<>
-- !query output

-- !query
CREATE OR REPLACE FUNCTION foo3_3at(x INT) RETURNS TABLE (a DOUBLE) RETURN 
SELECT 1 / x
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.catalyst.analysis.FunctionAlreadyExistsException
{
  "errorClass" : "ROUTINE_ALREADY_EXISTS",
  "sqlState" : "42723",
  "messageParameters" : {
    "existingRoutineType" : "routine",
    "newRoutineType" : "routine",
    "routineName" : "`default`.`foo3_3at`"
  }
}


> Fix create or replace SQL UDFs
> ------------------------------
>
>                 Key: SPARK-52148
>                 URL: https://issues.apache.org/jira/browse/SPARK-52148
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.1.0
>            Reporter: Allison Wang
>            Priority: Major
>
> CREATE OR REPLACE FUNCTION foo3_3at(x INT) RETURNS TABLE (a DOUBLE) RETURN 
> SELECT 1 / x
>  
>  
> CREATE OR REPLACE FUNCTION foo3_3at(x INT) RETURNS TABLE (a DOUBLE) RETURN 
> SELECT 1 / x
>  
>  
> -- !query schema
>  
>  
> -- !query schema
>  
>  
> struct<>
>  
>  
> struct<>
>  
>  
> -- !query output
>  
>  
> -- !query output
> Text moved with changes to lines 4840-4849 (97.4% similarity)
>  
>  
>  
> org.apache.spark.sql.catalyst.analysis.FunctionAlreadyExistsException
>  
>  
>  
>  
>  
> {
>  
>  
>  
>  
>  
>  "errorClass" : "ROUTINE_ALREADY_EXISTS",
>  
>  
>  
>  
>  
>  "sqlState" : "42723",
>  
>  
>  
>  
>  
>  "messageParameters" : {
>  
>  
>  
>  
>  
>  "existingRoutineType" : "routine",
>  
>  
>  
>  
>  
>  "newRoutineType" : "routine",
>  
>  
>  
>  
>  
>  "routineName" : "`default`.`foo3_3at`"
>  
>  
>  
>  
>  
>  }
>  
>  
>  
>  
>  
> }



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