org.apache.spark.sql.catalyst.parser.ParseException: no viable alternative at input 'SELECT 年'(line 1, pos 7) == SQL == SELECT 年龄 , 姓名 FROM table ORDER BY 年龄 ASC, 姓名 DESC -------^^^


Solutions on the web9

Solution icon of stackoverflow
no viable alternative at input 'SELECT '(line 1, pos 7) == SQL == SELECT , FROM table ORDER BY ASC, DESC -------^^^

Solution icon of stackoverflow
via Stack Overflow by Akrem
, 2 weeks ago
extraneous input '.' expecting {<EOF>, ',', 'SELECT', 'FROM', 'ADD', 'AS', 'ALL', 'DISTINCT', 'WHERE', 'GROUP', 'BY', 'GROUPING', 'SETS', 'CUBE', 'ROLLUP', 'ORDER', 'HAVING', 'LIMIT', 'AT', 'OR', 'AND', 'IN', NOT, 'NO', 'EXISTS', 'BETWEEN', 'LIKE

Solution icon of stackoverflow
mismatched input 'create' expecting (line 3, pos 0) == SQL == create table if not exists temp2(Col varchar(32)) create table if not exists temp3(Col varchar(32)) ^^^

Solution icon of stackoverflow
no viable alternative at input 'SELECT @'(line 1, pos 7) == SQL == SELECT @row_number:=@row_number+1 as rowid,d. FROM destination d, (SELECT @row_number:=0) as init -------^^^

Solution icon of stackoverflow
extraneous input ''' expecting {'(', 'SELECT', 'FROM', 'ADD', 'AS', 'ALL', 'DISTINCT', 'WHERE', 'GROUP', 'BY', 'GROUPING', 'SETS', 'CUBE', 'ROLLUP', 'ORDER', 'HAVING', 'LIMIT', 'AT', 'OR', 'AND', 'IN', NOT, 'NO', 'EXISTS', 'BETWEEN', 'LIKE', RLIKE

Solution icon of stackoverflow
via Stack Overflow by SailingYang
, 1 month ago
mismatched input 'idx' expecting {'(', 'SELECT', 'FROM', 'VALUES', 'TABLE', 'INSERT', 'MAP', 'REDUCE'}(line 1, pos 31) == SQL == insert into TABLE parquetFile (idx, name, age) values (200, "hello", 78) -------------------------------^^^

Solution icon of stackoverflow
via Stack Overflow by Sam-T
, 9 months ago
mismatched input 'FROM' expecting {<EOF>, 'WHERE', 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'LATERAL', 'WINDOW', 'UNION', 'EXCEPT', 'INTERSECT', 'SORT', 'CLUSTER', 'DISTRIBUTE'}(line 1, pos 14) == SQL == SELECT origin FROM origins WHERE origin like A* --------------^^^

Solution icon of stackoverflow
via Stack Overflow by John Doe
, 10 months ago
extraneous input '' expecting {'(', 'SELECT', .. == SQL == IncidntNum is not null ^^^

Solution icon of stackoverflow
extraneous input '(' expecting {'SELECT', 'FROM', 'ADD', 'AS', 'ALL', 'DISTINCT', == SQL == STRUCT ( `firstName`: STRING, `lastName`: STRING, `email`: STRING, `addresses`: ARRAY ( STRUCT ( `city`: STRING, `state`: STRING, `zip`: STRING ) ) ) -------^^^

Stack trace

org.apache.spark.sql.catalyst.parser.ParseException: no viable alternative at input 'SELECT 年'(line 1, pos 7)

== SQL ==
SELECT 年龄 , 姓名 FROM table ORDER BY 年龄 ASC, 姓名 DESC 
-------^^^
	at org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:197)
	at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:99)
	at org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:45)
	at org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:53)
	at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:592)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 6 months ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 3 months ago
Samebug visitor profile picture
Unknown user
Once, 3 months ago
Samebug visitor profile picture
Unknown user
Once, 3 months ago
3 more bugmates