[
https://issues.apache.org/jira/browse/SPARK-16848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15707699#comment-15707699
]
Pramod Anarase commented on SPARK-16848:
----------------------------------------
+1
> Make jdbc() and read.format("jdbc") consistently throwing exception for
> user-specified schema
> ---------------------------------------------------------------------------------------------
>
> Key: SPARK-16848
> URL: https://issues.apache.org/jira/browse/SPARK-16848
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Hyukjin Kwon
> Priority: Trivial
>
> Currently,
> {code}
> spark.read.schema(StructType(Seq())).jdbc(...),show()
> {code}
> does not throws an exception whereas
> {code}
> spark.read.schema(StructType(Seq())).option(...).format("jdbc").load().show()
> {code}
> does as below:
> {code}
> jdbc does not allow user-specified schemas.;
> org.apache.spark.sql.AnalysisException: jdbc does not allow user-specified
> schemas.;
> at
> org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:320)
> at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
> at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:122)
> at
> org.apache.spark.sql.jdbc.JDBCSuite$$anonfun$17.apply$mcV$sp(JDBCSuite.scala:351)
> {code}
> It'd make sense throwing the exception when user specifies schema identically.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]