[ https://issues.apache.org/jira/browse/SPARK-28674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Takeshi Yamamuro updated SPARK-28674: ------------------------------------- Parent Issue: SPARK-30374 (was: SPARK-27764) > Spark should support select <columnname> into <table> from <table> where > <condition> as PostgreSQL supports > ------------------------------------------------------------------------------------------------------------ > > Key: SPARK-28674 > URL: https://issues.apache.org/jira/browse/SPARK-28674 > Project: Spark > Issue Type: Sub-task > Components: SQL > Affects Versions: 2.4.0 > Reporter: ABHISHEK KUMAR GUPTA > Priority: Major > > Spark should support {{select <columnname> into <table> from <table> where > <condition>}} as PostgreSQL supports > {code} > create table dup(id int); > insert into dup values(1); > insert into dup values(2); > select id into test_dup from dup where id=1; > select * from test_dup; > {code} > *Result: Success in PostgreSQL* > But select id into test_dup from dup where id=1; in Spark gives ParseException > {code} > scala> sql("show tables").show(); > +--------+---------+-----------+ > |database|tableName|isTemporary| > +--------+---------+-----------+ > | func| dup| false| > +--------+---------+-----------+ > {code} > {code} > scala> sql("select id into test_dup from dup where id=1").show() > org.apache.spark.sql.catalyst.parser.ParseException: > mismatched input 'test_dup' expecting <EOF>(line 1, pos 15) > == SQL == > select id into test_dup from dup where id=1 > ---------------^^^ > at > org.apache.spark.sql.catalyst.parser.ParseException.withCommand(ParseDriver.scala:241) > at > org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parse(ParseDriver.scala:117) > at > org.apache.spark.sql.execution.SparkSqlParser.parse(SparkSqlParser.scala:48) > at > org.apache.spark.sql.catalyst.parser.AbstractSqlParser.parsePlan(ParseDriver.scala:69) > at org.apache.spark.sql.SparkSession.sql(SparkSession.scala:642) > ... 49 elided > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org