Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/10515#discussion_r48800650
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/DefaultSource.scala
---
@@ -70,15 +70,16 @@ class DefaultSource extends HadoopFsRelationProvider
with DataSourceRegister {
private[sql] class TextRelation(
val maybePartitionSpec: Option[PartitionSpec],
+ val textSchema: Option[StructType],
override val userDefinedPartitionColumns: Option[StructType],
override val paths: Array[String] = Array.empty[String],
parameters: Map[String, String] = Map.empty[String, String])
(@transient val sqlContext: SQLContext)
extends HadoopFsRelation(maybePartitionSpec, parameters) {
- /** Data schema is always a single column, named "value". */
- override def dataSchema: StructType = new StructType().add("value",
StringType)
-
+ /** Data schema is always a single column, named "value" if original
Data source has no schema. */
+ override def dataSchema: StructType =
+ textSchema.getOrElse(new StructType().add("value", StringType))
--- End diff --
oh, then it's fine
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]