Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,6 @@ CreateVariable defaultvalueexpression(null, null), false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.title


-- !query
DECLARE VARIABLE var1, var2, var3 INT
-- !query analysis
CreateVariable defaultvalueexpression(null, null), false
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
DECLARE OR REPLACE VARIABLE var1, var2 DOUBLE
-- !query analysis
CreateVariable defaultvalueexpression(null, null), true
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2


-- !query
DROP TEMPORARY VARIABLE var1
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1


-- !query
DROP TEMPORARY VARIABLE var2
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2


-- !query
DROP TEMPORARY VARIABLE var3
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
SET VARIABLE title = '-- Basic sanity --'
-- !query analysis
Expand Down Expand Up @@ -1284,6 +1246,147 @@ DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
SET VARIABLE title = 'DECLARE VARIABLE - multiple variables declared at once'
-- !query analysis
SetVariable [variablereference(system.session.title='SET VARIABLE - comma separated target')]
+- Project [DECLARE VARIABLE - multiple variables declared at once AS title#x]
+- OneRowRelation


-- !query
DECLARE VARIABLE var1, var2, var3 INT
-- !query analysis
CreateVariable defaultvalueexpression(null, null), false
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
DECLARE VARIABLE var4, var5, var6 INT DEFAULT CAST(RAND(0) * 10 AS INT)
-- !query analysis
[Analyzer test output redacted due to nondeterminism]


-- !query
DECLARE VARIABLE var7, var8, var9 DEFAULT 5
-- !query analysis
CreateVariable defaultvalueexpression(5, 5), false
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var7
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var8
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var9


-- !query
SELECT var4 = var5, var4 = var6, var5 = var6
-- !query analysis
Project [(variablereference(system.session.var4=7) = variablereference(system.session.var5=7)) AS (variablereference(system.session.var4=7) = variablereference(system.session.var5=7))#x, (variablereference(system.session.var4=7) = variablereference(system.session.var6=7)) AS (variablereference(system.session.var4=7) = variablereference(system.session.var6=7))#x, (variablereference(system.session.var5=7) = variablereference(system.session.var6=7)) AS (variablereference(system.session.var5=7) = variablereference(system.session.var6=7))#x]
+- OneRowRelation


-- !query
DECLARE OR REPLACE VARIABLE var1, var2, var3 DOUBLE
-- !query analysis
CreateVariable defaultvalueexpression(null, null), true
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
DECLARE OR REPLACE VARIABLE var4, var5, var6 DOUBLE DEFAULT RAND(0)
-- !query analysis
[Analyzer test output redacted due to nondeterminism]


-- !query
DECLARE OR REPLACE VARIABLE var7, var8, var9 DEFAULT 1.5
-- !query analysis
CreateVariable defaultvalueexpression(1.5, 1.5), true
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var7
:- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var8
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var9


-- !query
SELECT var4 = var5, var4 = var6, var5 = var6
-- !query analysis
Project [(variablereference(system.session.var4=0.7604953758285915D) = variablereference(system.session.var5=0.7604953758285915D)) AS (variablereference(system.session.var4=0.7604953758285915D) = variablereference(system.session.var5=0.7604953758285915D))#x, (variablereference(system.session.var4=0.7604953758285915D) = variablereference(system.session.var6=0.7604953758285915D)) AS (variablereference(system.session.var4=0.7604953758285915D) = variablereference(system.session.var6=0.7604953758285915D))#x, (variablereference(system.session.var5=0.7604953758285915D) = variablereference(system.session.var6=0.7604953758285915D)) AS (variablereference(system.session.var5=0.7604953758285915D) = variablereference(system.session.var6=0.7604953758285915D))#x]
+- OneRowRelation


-- !query
DROP TEMPORARY VARIABLE var1
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var1


-- !query
DROP TEMPORARY VARIABLE var2
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var2


-- !query
DROP TEMPORARY VARIABLE var3
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var3


-- !query
DROP TEMPORARY VARIABLE var4
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var4


-- !query
DROP TEMPORARY VARIABLE var5
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var5


-- !query
DROP TEMPORARY VARIABLE var6
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var6


-- !query
DROP TEMPORARY VARIABLE var7
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var7


-- !query
DROP TEMPORARY VARIABLE var8
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var8


-- !query
DROP TEMPORARY VARIABLE var9
-- !query analysis
DropVariable false
+- ResolvedIdentifier org.apache.spark.sql.catalyst.analysis.FakeSystemCatalog$@xxxxxxxx, session.var9


-- !query
SET VARIABLE title = 'DECLARE VARIABLE - duplicate names'
-- !query analysis
SetVariable [variablereference(system.session.title='DECLARE VARIABLE - multiple variables declared at once')]
+- Project [DECLARE VARIABLE - duplicate names AS title#x]
+- OneRowRelation


-- !query
DECLARE VARIABLE var1, var2, vAr1 INT
-- !query analysis
Expand Down Expand Up @@ -1313,7 +1416,7 @@ org.apache.spark.sql.AnalysisException
-- !query
SET VARIABLE title = 'SET VARIABLE - row assignment'
-- !query analysis
SetVariable [variablereference(system.session.title='SET VARIABLE - comma separated target')]
SetVariable [variablereference(system.session.title='DECLARE VARIABLE - duplicate names')]
+- Project [SET VARIABLE - row assignment AS title#x]
+- OneRowRelation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ SET spark.sql.ansi.enabled = true;

DECLARE title STRING;

DECLARE VARIABLE var1, var2, var3 INT;

DECLARE OR REPLACE VARIABLE var1, var2 DOUBLE;

DROP TEMPORARY VARIABLE var1;
DROP TEMPORARY VARIABLE var2;
DROP TEMPORARY VARIABLE var3;

SET VARIABLE title = '-- Basic sanity --';
DECLARE var1 INT = 5;
SELECT var1;
Expand Down Expand Up @@ -215,8 +207,33 @@ DROP TEMPORARY VARIABLE var1;
DROP TEMPORARY VARIABLE var2;
DROP TEMPORARY VARIABLE var3;

DECLARE VARIABLE var1, var2, vAr1 INT;
SET VARIABLE title = 'DECLARE VARIABLE - multiple variables declared at once';

DECLARE VARIABLE var1, var2, var3 INT;
DECLARE VARIABLE var4, var5, var6 INT DEFAULT CAST(RAND(0) * 10 AS INT);
DECLARE VARIABLE var7, var8, var9 DEFAULT 5;

SELECT var4 = var5, var4 = var6, var5 = var6;

DECLARE OR REPLACE VARIABLE var1, var2, var3 DOUBLE;
DECLARE OR REPLACE VARIABLE var4, var5, var6 DOUBLE DEFAULT RAND(0);
DECLARE OR REPLACE VARIABLE var7, var8, var9 DEFAULT 1.5;

SELECT var4 = var5, var4 = var6, var5 = var6;

DROP TEMPORARY VARIABLE var1;
DROP TEMPORARY VARIABLE var2;
DROP TEMPORARY VARIABLE var3;
DROP TEMPORARY VARIABLE var4;
DROP TEMPORARY VARIABLE var5;
DROP TEMPORARY VARIABLE var6;
DROP TEMPORARY VARIABLE var7;
DROP TEMPORARY VARIABLE var8;
DROP TEMPORARY VARIABLE var9;

SET VARIABLE title = 'DECLARE VARIABLE - duplicate names';

DECLARE VARIABLE var1, var2, vAr1 INT;
DECLARE OR REPLACE VARIABLE var1, var2, vAr1 INT;

SET VARIABLE title = 'SET VARIABLE - row assignment';
Expand Down
Loading