Package org.apache.spark.sql.types
Class Metadata
Object
org.apache.spark.sql.types.Metadata
- All Implemented Interfaces:
Serializable
,scala.Serializable
Metadata is a wrapper over Map[String, Any] that limits the value type to simple ones: Boolean,
Long, Double, String, Metadata, Array[Boolean], Array[Long], Array[Double], Array[String], and
Array[Metadata]. JSON is used for serialization.
The default constructor is private. User should use either MetadataBuilder
or
Metadata.fromJson()
to create Metadata instances.
param: map an immutable map that stores the data
- Since:
- 1.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests whether this Metadata contains a binding for a key.static Metadata
empty()
Returns an empty Metadata.boolean
static Metadata
Creates a Metadata instance from JSON.boolean
getBoolean
(String key) Gets a Boolean.boolean[]
getBooleanArray
(String key) Gets a Boolean array.double
Gets a Double.double[]
getDoubleArray
(String key) Gets a Double array.long
Gets a Long.long[]
getLongArray
(String key) Gets a Long array.getMetadata
(String key) Gets a Metadata.Metadata[]
getMetadataArray
(String key) Gets a Metadata array.Gets a String.String[]
getStringArray
(String key) Gets a String array.int
hashCode()
json()
Converts to its JSON representation.toString()
-
Method Details
-
empty
Returns an empty Metadata. -
fromJson
Creates a Metadata instance from JSON. -
contains
Tests whether this Metadata contains a binding for a key. -
getLong
Gets a Long. -
getDouble
Gets a Double. -
getBoolean
Gets a Boolean. -
getString
Gets a String. -
getMetadata
Gets a Metadata. -
getLongArray
Gets a Long array. -
getDoubleArray
Gets a Double array. -
getBooleanArray
Gets a Boolean array. -
getStringArray
Gets a String array. -
getMetadataArray
Gets a Metadata array. -
json
Converts to its JSON representation. -
toString
-
equals
-
hashCode
public int hashCode()
-