Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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 @@ -5,7 +5,12 @@ select concat_ws()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
requirement failed: concat_ws requires at least one argument.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "requirement failed: concat_ws requires at least one argument.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -14,7 +19,12 @@ select format_string()
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
requirement failed: format_string() should take at least 1 argument; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "requirement failed: format_string() should take at least 1 argument; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down Expand Up @@ -1579,7 +1589,12 @@ select to_binary('abc', 1)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
The 'format' parameter of function 'to_binary' needs to be a string literal.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "The 'format' parameter of function 'to_binary' needs to be a string literal.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ SELECT i1 FROM t1, mydb1.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 'i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 'i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -78,7 +83,12 @@ SELECT t1.i1 FROM t1, mydb1.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -87,7 +97,12 @@ SELECT mydb1.t1.i1 FROM t1, mydb1.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 'mydb1.t1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 'mydb1.t1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -96,7 +111,12 @@ SELECT i1 FROM t1, mydb2.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 'i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 'i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -105,7 +125,12 @@ SELECT t1.i1 FROM t1, mydb2.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb1.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -122,7 +147,12 @@ SELECT i1 FROM t1, mydb1.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 'i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 'i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -131,7 +161,12 @@ SELECT t1.i1 FROM t1, mydb1.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb1.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -140,7 +175,12 @@ SELECT i1 FROM t1, mydb2.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 'i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 'i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -149,7 +189,12 @@ SELECT t1.i1 FROM t1, mydb2.t1
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Reference 't1.i1' is ambiguous, could be: spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down
55 changes: 36 additions & 19 deletions sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ select from_csv('1', 1)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
The expression '1' is not a valid schema string.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "The expression '1' is not a valid schema string.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -30,20 +35,12 @@ select from_csv('1', 'a InvalidType')
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Cannot parse the data type:
[PARSE_SYNTAX_ERROR] Syntax error at or near 'InvalidType': extra input 'InvalidType'(line 1, pos 2)

== SQL ==
a InvalidType
--^^^

Failed fallback parsing:
DataType invalidtype is not supported.(line 1, pos 2)

== SQL ==
a InvalidType
--^^^
; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Cannot parse the data type: \n[PARSE_SYNTAX_ERROR] Syntax error at or near 'InvalidType': extra input 'InvalidType'(line 1, pos 2)\n\n== SQL ==\na InvalidType\n--^^^\n\nFailed fallback parsing: \nDataType invalidtype is not supported.(line 1, pos 2)\n\n== SQL ==\na InvalidType\n--^^^\n; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -52,7 +49,12 @@ 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
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Must use a map() function for options.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -61,7 +63,12 @@ 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
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down Expand Up @@ -187,7 +194,12 @@ 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
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Must use a map() function for options.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand All @@ -196,4 +208,9 @@ 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
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "A type of keys and values in map() must be string, but got map<string,int>.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
35 changes: 30 additions & 5 deletions sql/core/src/test/resources/sql-tests/results/extract.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,12 @@ select extract(not_supported from c) from t
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Literals of type 'not_supported' are currently not supported for the string type.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"message" : "Literals of type 'not_supported' are currently not supported for the string type.; line 1 pos 7"
}
}


-- !query
Expand All @@ -326,7 +331,12 @@ select extract(not_supported from i) from t
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Literals of type 'not_supported' are currently not supported for the interval year to month type.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"message" : "Literals of type 'not_supported' are currently not supported for the interval year to month type.; line 1 pos 7"
}
}


-- !query
Expand All @@ -335,7 +345,12 @@ select extract(not_supported from j) from t
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Literals of type 'not_supported' are currently not supported for the interval day to second type.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"message" : "Literals of type 'not_supported' are currently not supported for the interval day to second type.; line 1 pos 7"
}
}


-- !query
Expand Down Expand Up @@ -924,7 +939,12 @@ select extract(DAY from interval '2-1' YEAR TO MONTH)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Literals of type 'DAY' are currently not supported for the interval year to month type.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Literals of type 'DAY' are currently not supported for the interval year to month type.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down Expand Up @@ -1081,7 +1101,12 @@ select extract(MONTH from interval '123 12:34:56.789123123' DAY TO SECOND)
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
Literals of type 'MONTH' are currently not supported for the interval day to second type.; line 1 pos 7
{
"errorClass" : "LEGACY",
"messageParameters" : {
"message" : "Literals of type 'MONTH' are currently not supported for the interval day to second type.; line 1 pos 7"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}


-- !query
Expand Down
Loading