case class StructField(name: String, dataType: DataType, nullable: Boolean = true, metadata: Metadata = Metadata.empty) extends Product with Serializable
A field inside a StructType.
- name
The name of this field.
- dataType
The data type of this field.
- nullable
Indicates if values of this field can be
null
values.- metadata
The metadata of this field. The metadata should be preserved during transformation if the content of the column is not modified, e.g, in selection.
- Annotations
- @Stable()
- Source
- StructField.scala
- Since
1.3.0
- Alphabetic
- By Inheritance
- StructField
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
StructField()
No-arg constructor for kryo.
No-arg constructor for kryo.
- Attributes
- protected
-
new
StructField(name: String, dataType: DataType, nullable: Boolean = true, metadata: Metadata = Metadata.empty)
- name
The name of this field.
- dataType
The data type of this field.
- nullable
Indicates if values of this field can be
null
values.- metadata
The metadata of this field. The metadata should be preserved during transformation if the content of the column is not modified, e.g, in selection.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clearCurrentDefaultValue(): StructField
Clears the StructField of its current default value, if any.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- val dataType: DataType
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getComment(): Option[String]
Return the comment of this StructField.
-
def
getCurrentDefaultValue(): Option[String]
Return the current default value of this StructField.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val metadata: Metadata
- val name: String
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val nullable: Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toDDL: String
Returns a string containing a schema in DDL format.
Returns a string containing a schema in DDL format. For example, the following value:
StructField("eventId", IntegerType, false)
will be converted toeventId
INT NOT NULL.StructField("eventId", IntegerType, true)
will be converted toeventId
INT.- Since
2.4.0
-
def
toString(): String
- Definition Classes
- StructField → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withComment(comment: String): StructField
Updates the StructField with a new comment value.
-
def
withCurrentDefaultValue(value: String): StructField
Updates the StructField with a new current default value.
-
def
withExistenceDefaultValue(value: String): StructField
Updates the StructField with a new existence default value.