Skip to content
502 changes: 502 additions & 0 deletions core/src/main/resources/error/error-classes.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ class AnalysisErrorSuite extends AnalysisTest {
errorTest(
"unresolved star expansion in max",
testRelation2.groupBy($"a")(sum(UnresolvedStar(None))),
"Invalid usage of '*'" :: "in expression 'sum'" :: Nil)
"Invalid usage of '*' in expression 'sum'." :: Nil)

errorTest(
"sorting by unsupported column types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,21 @@ select decode()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function decode. Expected: 2; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "2",
"name" : "decode"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 15,
"fragment" : "decode()"
} ]
}


-- !query
Expand All @@ -767,7 +781,21 @@ select decode(encode('abc', 'utf-8'))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function decode. Expected: 2; Found: 1; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "1",
"expectedInfo" : "2",
"name" : "decode"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 37,
"fragment" : "decode(encode('abc', 'utf-8'))"
} ]
}


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,21 @@ SELECT CEIL(2.5, 0, 0)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function ceil. Expected: 2; Found: 3; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "3",
"expectedInfo" : "2",
"name" : "ceil"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 22,
"fragment" : "CEIL(2.5, 0, 0)"
} ]
}


-- !query
Expand Down Expand Up @@ -226,4 +240,18 @@ SELECT FLOOR(2.5, 0, 0)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function floor. Expected: 2; Found: 3; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "3",
"expectedInfo" : "2",
"name" : "floor"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 23,
"fragment" : "FLOOR(2.5, 0, 0)"
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,22 @@ ALTER TABLE temp_view CHANGE a TYPE INT
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
temp_view is a temp view. 'ALTER TABLE ... CHANGE COLUMN' expects a table.; line 1 pos 12
{
"errorClass" : "_LEGACY_ERROR_TEMP_1013",
"messageParameters" : {
"cmd" : "ALTER TABLE ... CHANGE COLUMN",
"hintStr" : "",
"nameParts" : "temp_view",
"viewStr" : "temp view"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 13,
"stopIndex" : 21,
"fragment" : "temp_view"
} ]
}


-- !query
Expand All @@ -271,7 +286,22 @@ ALTER TABLE global_temp.global_temp_view CHANGE a TYPE INT
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
global_temp.global_temp_view is a temp view. 'ALTER TABLE ... CHANGE COLUMN' expects a table.; line 1 pos 12
{
"errorClass" : "_LEGACY_ERROR_TEMP_1013",
"messageParameters" : {
"cmd" : "ALTER TABLE ... CHANGE COLUMN",
"hintStr" : "",
"nameParts" : "global_temp.global_temp_view",
"viewStr" : "temp view"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 13,
"stopIndex" : 40,
"fragment" : "global_temp.global_temp_view"
} ]
}


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,20 @@ SELECT t1.x.y.* FROM t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
cannot resolve 't1.x.y.*' given input columns 'i1'; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1051",
"messageParameters" : {
"columns" : "i1",
"targetString" : "t1.x.y"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 15,
"fragment" : "t1.x.y.*"
} ]
}


-- !query
Expand Down
7 changes: 6 additions & 1 deletion sql/core/src/test/resources/sql-tests/results/count.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,9 @@ SELECT count(testData.*) FROM testData
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
count(testData.*) is not allowed. Please use count(*) or expand the columns manually, e.g. count(col1, col2)
{
"errorClass" : "_LEGACY_ERROR_TEMP_1021",
"messageParameters" : {
"targetString" : "testData"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ select from_csv('1', 'a INT', named_struct('mode', 'PERMISSIVE'))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Must use a map() function for options; line 1 pos 7
Must use a map() function for options.; line 1 pos 7


-- !query
Expand All @@ -61,7 +61,7 @@ select from_csv('1', 'a INT', map('mode', 1))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
A type of keys and values in map() must be string, but got map<string,int>; line 1 pos 7
A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7


-- !query
Expand All @@ -70,7 +70,21 @@ select from_csv()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function from_csv. Expected: one of 2 and 3; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "one of 2 and 3",
"name" : "from_csv"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 17,
"fragment" : "from_csv()"
} ]
}


-- !query
Expand Down Expand Up @@ -173,7 +187,7 @@ select to_csv(named_struct('a', 1, 'b', 2), named_struct('mode', 'PERMISSIVE'))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Must use a map() function for options; line 1 pos 7
Must use a map() function for options.; line 1 pos 7


-- !query
Expand All @@ -182,4 +196,4 @@ select to_csv(named_struct('a', 1, 'b', 2), map('mode', 1))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
A type of keys and values in map() must be string, but got map<string,int>; line 1 pos 7
A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ select * from data group by a, b, 1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Star (*) is not allowed in select list when GROUP BY ordinal position is used
{
"errorClass" : "_LEGACY_ERROR_TEMP_1019"
}


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,20 @@ SELECT * FROM t1, LATERAL (SELECT t1.*, t2.* FROM t2, LATERAL (SELECT t1.*, t2.*
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
cannot resolve 't1.*' given input columns 'c1, c2'; line 1 pos 70
{
"errorClass" : "_LEGACY_ERROR_TEMP_1051",
"messageParameters" : {
"columns" : "c1, c2",
"targetString" : "t1"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 71,
"stopIndex" : 74,
"fragment" : "t1.*"
} ]
}


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ select to_json(named_struct('a', 1, 'b', 2), named_struct('mode', 'PERMISSIVE'))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Must use a map() function for options; line 1 pos 7
Must use a map() function for options.; line 1 pos 7


-- !query
Expand All @@ -78,7 +78,7 @@ select to_json(named_struct('a', 1, 'b', 2), map('mode', 1))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
A type of keys and values in map() must be string, but got map<string,int>; line 1 pos 7
A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7


-- !query
Expand All @@ -87,7 +87,21 @@ select to_json()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function to_json. Expected: one of 1 and 2; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "one of 1 and 2",
"name" : "to_json"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 16,
"fragment" : "to_json()"
} ]
}


-- !query
Expand Down Expand Up @@ -143,7 +157,7 @@ select from_json('{"a":1}', 'a INT', named_struct('mode', 'PERMISSIVE'))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Must use a map() function for options; line 1 pos 7
Must use a map() function for options.; line 1 pos 7


-- !query
Expand All @@ -152,7 +166,7 @@ select from_json('{"a":1}', 'a INT', map('mode', 1))
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
A type of keys and values in map() must be string, but got map<string,int>; line 1 pos 7
A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7


-- !query
Expand All @@ -161,7 +175,21 @@ select from_json()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function from_json. Expected: one of 2 and 3; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "one of 2 and 3",
"name" : "from_json"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 18,
"fragment" : "from_json()"
} ]
}


-- !query
Expand Down Expand Up @@ -491,7 +519,21 @@ select json_array_length()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function json_array_length. Expected: 1; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "1",
"name" : "json_array_length"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 26,
"fragment" : "json_array_length()"
} ]
}


-- !query
Expand Down Expand Up @@ -564,7 +606,21 @@ select json_object_keys()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Invalid number of arguments for function json_object_keys. Expected: 1; Found: 0; line 1 pos 7
{
"errorClass" : "_LEGACY_ERROR_TEMP_1042",
"messageParameters" : {
"actualNumber" : "0",
"expectedInfo" : "1",
"name" : "json_object_keys"
},
"queryContext" : [ {
"objectType" : "",
"objectName" : "",
"startIndex" : 8,
"stopIndex" : 25,
"fragment" : "json_object_keys()"
} ]
}


-- !query
Expand Down
Loading