本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Scala 库中的APIsAWS Glue
AWS Glue 支持使用 PySpark Scala 方言的扩展来编写提取、转换和加载 (ETL) 作业脚本。以下部分介绍 APIs Scala 库中的 AWS Glue。
com.amazonaws.services.glue
Scala 库中的 com.amazonaws.services.glue 程序包包含以下 AWS Glue:APIs
com.amazonaws.services.glue.ml
Scala 库中的 com.amazonaws.services.glue.ml 程序包包含以下 AWS Glue:APIs
com.amazonaws.services.glue.types
Scala 库中的 com.amazonaws.services.glue.types 程序包包含以下 AWS Glue:APIs
com.amazonaws.services.glue.util
Scala 库中的 com.amazonaws.services.glue.util 程序包包含以下 AWS Glue:APIs
MappingSpec
程序包:com.amazonaws.services.glue
MappingSpec 案例类别
case class MappingSpec( sourcePath: SchemaPath,
sourceType: DataType,
targetPath: SchemaPath,
targetType: DataTyp
) extends Product4[String, String, String, String] {
override def _1: String = sourcePath.toString
override def _2: String = ExtendedTypeName.fromDataType(sourceType)
override def _3: String = targetPath.toString
override def _4: String = ExtendedTypeName.fromDataType(targetType)
}
-
sourcePath
— 源字段的SchemaPath
。 -
sourceType
— 源字段的DataType
。 -
targetPath
— 目标字段的SchemaPath
。 -
targetType
— 目标字段的DataType
。
MappingSpec
指定从源路径和源数据类型到目标路径和目标数据类型的映射。源路径的源帧中的值会显示在目标路径的目标帧中。源数据类型将强制转换为目标数据类型。
它从 Product4
扩展而来,因此您可在 applyMapping
接口中处理任何 Product4
。
MappingSpec 对象
object MappingSpec
MappingSpec
对象具有以下成员:
阀 orderingByTarget
val orderingByTarget: Ordering[MappingSpec]
def apply
def apply( sourcePath : String,
sourceType : DataType,
targetPath : String,
targetType : DataType
) : MappingSpec
创建 MappingSpec
。
-
sourcePath
— 源路径的字符串表示形式。 -
sourceType
— 来源DataType
. -
targetPath
— 目标路径的字符串表示形式。 -
targetType
— 目标DataType
.
返回 MappingSpec
。
def apply
def apply( sourcePath : String,
sourceTypeString : String,
targetPath : String,
targetTypeString : String
) : MappingSpec
创建 MappingSpec
。
-
sourcePath
— 源路径的字符串表示形式。 -
sourceType
— 源数据类型的字符串表示形式。 -
targetPath
— 目标路径的字符串表示形式。 -
targetType
— 目标数据类型的字符串表示形式。
返回 MappingSpec。
def apply
def apply( product : Product4[String, String, String, String] ) : MappingSpec
创建 MappingSpec
。
-
product
— 源路径、源数据类型、目标路径和目标数据类型的Product4
。
返回 MappingSpec
。