spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aman Omer (Jira)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (SPARK-29591) Support data insertion in a different order if you wish or even omit some columns in spark sql also like postgresql
Date Wed, 04 Dec 2019 11:31:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-29591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Aman Omer updated SPARK-29591:
------------------------------
    Comment: was deleted

(was: Thanks for confirming. I will start working on this.)

> Support data insertion in a different order if you wish or even omit some columns in
spark sql also like postgresql
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-29591
>                 URL: https://issues.apache.org/jira/browse/SPARK-29591
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 2.4.4
>            Reporter: jobit mathew
>            Priority: Major
>
> Support data insertion in a different order if you wish or even omit some columns in
spark sql also like postgre sql.
> *In postgre sql*
> {code:java}
> CREATE TABLE weather (
>  city varchar(80),
>  temp_lo int, – low temperature
>  temp_hi int, – high temperature
>  prcp real, – precipitation
>  date date
>  );
> {code}
> *You can list the columns in a different order if you wish or even omit some columns,*
> {code:java}
> INSERT INTO weather (date, city, temp_hi, temp_lo)
>  VALUES ('1994-11-29', 'Hayward', 54, 37);
> {code}
>  
> *Spark SQL*
> But in spark sql is not allowing to insert data in different order or omit any column.Better
to support this as it can save time if we can not predict any specific column value or if
some value is fixed always.
> {code:java}
> create table jobit(id int,name string);
> > insert into jobit values(1,"Ankit");
>  Time taken: 0.548 seconds
>  spark-sql> *insert into jobit (id) values(1);*
>  *Error in query:*
>  mismatched input 'id' expecting \{'(', 'SELECT', 'FROM', 'VALUES', 'TABLE', 'INSERT',
'MAP', 'REDUCE'}(line 1, pos 19)
> == SQL ==
>  insert into jobit (id) values(1)
>  -------------------^^^
> spark-sql> *insert into jobit (name,id) values("Ankit",1);*
>  *Error in query:*
>  mismatched input 'name' expecting \{'(', 'SELECT', 'FROM', 'VALUES', 'TABLE', 'INSERT',
'MAP', 'REDUCE'}(line 1, pos 19)
> == SQL ==
>  insert into jobit (name,id) values("Ankit",1)
>  -------------------^^^
> spark-sql>
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message