Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

why all fields are nullable #288

Description

@yuryn

When I read simple avro file with all fileds non-nullable, resulted dataframe schema has all fields nullable.

avro file schema:

{
  "type" : "record",
  "name" : "RobotDetection",
  "namespace" : "cz.search.robotdetection",
  "fields" : [ {
    "name" : "sessionId",
    "type" : "string"
  }, {
    "name" : "robotDetectionResult",
    "type" : "int"
  } ]
}

dataframe schema:

val a = spark.read.format("com.databricks.spark.avro").load("avrofile.avro")
a.schema
res1: org.apache.spark.sql.types.StructType = StructType(StructField(sessionId,StringType,true), StructField(robotDetectionResult,IntegerType,true))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions