flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "thinktothings (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-11924) Exception in thread "main" org.apache.flink.table.api.SqlParserException: SQL parse failed. Encountered "EXISTS" at line 1, column 40.
Date Fri, 15 Mar 2019 02:42:00 GMT
thinktothings created FLINK-11924:
-------------------------------------

             Summary: Exception in thread "main" org.apache.flink.table.api.SqlParserException:
SQL parse failed. Encountered "EXISTS" at line 1, column 40.
                 Key: FLINK-11924
                 URL: https://issues.apache.org/jira/browse/FLINK-11924
             Project: Flink
          Issue Type: Bug
          Components: API / Table SQL
    Affects Versions: 1.7.2
         Environment: ).os mac 10.14.3 

).java  1.8.0_191

).2.11.12

).flink 1.7.2

-----------------------------------------------------------------------------------------------------

EXISTS is error,but i replace in is ok

 

-----------------------------------------------------------------------------------------------------

 

 

 

package com.opensourceteams.module.bigdata.flink.example.sql.dataset.operations.setOperations.exists

import org.apache.flink.api.scala.\{ExecutionEnvironment, _}
import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.api.scala._

object Run {



 def main(args: Array[String]): Unit = {


 //得到批环境
 val env = ExecutionEnvironment.getExecutionEnvironment


 val dataSet = env.fromElements((1,"小明",15,"男",1500),(2,"小王",45,"男",4000),(3,"小李",25,"女",800),(4,"小慧",35,"女",500))
 val dataSet2 = env.fromElements((1,"小明",15,"男",1500),(2,"小王",45,"男",4000),(30,"小李",25,"女",800),(40,"小慧",35,"女",500))

 //得到Table环境
 val tableEnv = TableEnvironment.getTableEnvironment(env)
 //注册table
 tableEnv.registerDataSet("user",dataSet,'id,'name,'age,'sex,'salary)
 tableEnv.registerDataSet("t2",dataSet2,'id,'name,'age,'sex,'salary)


 /**
 * in ,子查询
 */
 tableEnv.sqlQuery(

 "select t1.* FROM `user`as t1 where id EXISTS " +
 " (select id from t2) "




 )
 .first(100).print()


 

 }

}
            Reporter: thinktothings


Exception in thread "main" org.apache.flink.table.api.SqlParserException: SQL parse failed.
Encountered "EXISTS" at line 1, column 40.
Was expecting one of:
 <EOF> 
 "ORDER" ...
 "LIMIT" ...
 "OFFSET" ...
 "FETCH" ...
 "GROUP" ...
 "HAVING" ...
 "WINDOW" ...
 "UNION" ...
 "INTERSECT" ...
 "EXCEPT" ...
 "MINUS" ...
 "NOT" ...
 "IN" ...
 "<" ...
 "<=" ...
 ">" ...
 ">=" ...
 "=" ...
 "<>" ...
 "!=" ...
 "BETWEEN" ...
 "LIKE" ...
 "SIMILAR" ...
 "+" ...
 "-" ...
 "*" ...
 "/" ...
 "%" ...
 "||" ...
 "AND" ...
 "OR" ...
 "IS" ...
 "MEMBER" ...
 "SUBMULTISET" ...
 "CONTAINS" ...
 "OVERLAPS" ...
 "EQUALS" ...
 "PRECEDES" ...
 "SUCCEEDS" ...
 "IMMEDIATELY" ...
 "MULTISET" ...
 "[" ...
 "." ...
 "(" ...
 
 at org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:94)
 at org.apache.flink.table.api.TableEnvironment.sqlQuery(TableEnvironment.scala:743)
 at com.opensourceteams.module.bigdata.flink.example.sql.dataset.operations.setOperations.exists.Run$.main(Run.scala:31)
 at com.opensourceteams.module.bigdata.flink.example.sql.dataset.operations.setOperations.exists.Run.main(Run.scala)
Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "EXISTS" at line 1,
column 40.
Was expecting one of:
 <EOF> 
 "ORDER" ...
 "LIMIT" ...
 "OFFSET" ...
 "FETCH" ...
 "GROUP" ...
 "HAVING" ...
 "WINDOW" ...
 "UNION" ...
 "INTERSECT" ...
 "EXCEPT" ...
 "MINUS" ...
 "NOT" ...
 "IN" ...
 "<" ...
 "<=" ...
 ">" ...
 ">=" ...
 "=" ...
 "<>" ...
 "!=" ...
 "BETWEEN" ...
 "LIKE" ...
 "SIMILAR" ...
 "+" ...
 "-" ...
 "*" ...
 "/" ...
 "%" ...
 "||" ...
 "AND" ...
 "OR" ...
 "IS" ...
 "MEMBER" ...
 "SUBMULTISET" ...
 "CONTAINS" ...
 "OVERLAPS" ...
 "EQUALS" ...
 "PRECEDES" ...
 "SUCCEEDS" ...
 "IMMEDIATELY" ...
 "MULTISET" ...
 "[" ...
 "." ...
 "(" ...
 
 at org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:347)
 at org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:128)
 at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:137)
 at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:162)
 at org.apache.flink.table.calcite.FlinkPlannerImpl.parse(FlinkPlannerImpl.scala:90)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message