You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Huaxin Gao (JIRA)" <ji...@apache.org> on 2016/06/03 06:06:59 UTC

[jira] [Updated] (SPARK-15749) Make the error message more meaningful

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

Huaxin Gao updated SPARK-15749:
-------------------------------
    Description: 
For table test1 (C1 varchar (10), C2 varchar (10)), when I insert a row using 

sqlContext.sql("insert into test1 values ('abc', 'def', 1)")

I got error message


Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
 requires that the query in the SELECT clause of the INSERT INTO/OVERWRITE statement generates the same number of columns as its schema.


The error message is a little confusing. In my simple insert statement, it doesn't have a SELECT clause. 

I will change the error message to a more general one 

Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
 requires that the data to be inserted have the same number of columns as the target table.



  was:
For table test1 (C1 varchar (10), C2 varchar (10)), when I insert a row using 
```
sqlContext.sql("insert into test1 values ('abc', 'def', 1)")
```
I got error message

```
Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
 requires that the query in the SELECT clause of the INSERT INTO/OVERWRITE statement generates the same number of columns as its schema.
```

The error message is a little confusing. In my simple insert statement, it doesn't have a SELECT clause. 

I will change the error message to a more general one 
```
Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
 requires that the data to be inserted have the same number of columns as the target table.
```



> Make the error message more meaningful
> --------------------------------------
>
>                 Key: SPARK-15749
>                 URL: https://issues.apache.org/jira/browse/SPARK-15749
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Huaxin Gao
>            Priority: Trivial
>
> For table test1 (C1 varchar (10), C2 varchar (10)), when I insert a row using 
> sqlContext.sql("insert into test1 values ('abc', 'def', 1)")
> I got error message
> Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
>  requires that the query in the SELECT clause of the INSERT INTO/OVERWRITE statement generates the same number of columns as its schema.
> The error message is a little confusing. In my simple insert statement, it doesn't have a SELECT clause. 
> I will change the error message to a more general one 
> Exception in thread "main" java.lang.RuntimeException: Relation[C1#0,C2#1] JDBCRelation(test1)
>  requires that the data to be inserted have the same number of columns as the target table.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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