object DataType
- Annotations
- @Stable()
- Source
- DataType.scala
- Since
1.3.0
- Alphabetic
- By Inheritance
- DataType
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
buildFormattedString(dataType: DataType, prefix: String, stringConcat: StringConcat, maxDepth: Int): Unit
- Attributes
- protected[types]
-
def
canWrite(write: DataType, read: DataType, byName: Boolean, resolver: Resolver, context: String, storeAssignmentPolicy: internal.SQLConf.StoreAssignmentPolicy.Value, addError: (String) ⇒ Unit): Boolean
Returns true if the write data type can be read using the read data type.
Returns true if the write data type can be read using the read data type.
The write type is compatible with the read type if: - Both types are arrays, the array element types are compatible, and element nullability is compatible (read allows nulls or write does not contain nulls). - Both types are maps and the map key and value types are compatible, and value nullability is compatible (read allows nulls or write does not contain nulls). - Both types are structs and have the same number of fields. The type and nullability of each field from read/write is compatible. If byName is true, the name of each field from read/write needs to be the same. - Both types are atomic and the write type can be safely cast to the read type.
Extra fields in write-side structs are not allowed to avoid accidentally writing data that the read schema will not read, and to ensure map key equality is not changed when data is read.
- write
a write-side data type to validate against the read type
- read
a read-side data type
- returns
true if data written with the write type can be read using the read type
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
equalsStructurally(from: DataType, to: DataType, ignoreNullability: Boolean = false): Boolean
Returns true if the two data types share the same "shape", i.e.
Returns true if the two data types share the same "shape", i.e. the types are the same, but the field names don't need to be the same.
- ignoreNullability
whether to ignore nullability when comparing the types
-
def
equalsStructurallyByName(from: DataType, to: DataType, resolver: Resolver): Boolean
Returns true if the two data types have the same field names in order recursively.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def fromDDL(ddl: String): DataType
- def fromJson(json: String): DataType
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
def
parseTypeWithFallback(schema: String, parser: (String) ⇒ DataType, fallbackParser: (String) ⇒ DataType): DataType
Parses data type from a string with schema.
Parses data type from a string with schema. It calls
parser
forschema
. If it fails, callsfallbackParser
. If the fallback function fails too, combines error message fromparser
andfallbackParser
.- schema
The schema string to parse by
parser
orfallbackParser
.- parser
The function that should be invoke firstly.
- fallbackParser
The function that is called when
parser
fails.- returns
The data type parsed from the
schema
schema.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- 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()