Amazon Glue Scala 库中的 API - Amazon Glue
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

Amazon Glue Scala 库中的 API

Amazon Glue 支持使用 PySpark Scala 方言的扩展来编写提取、转换和加载 (ETL) 作业脚本。以下部分描述了 Amazon Glue Scala 库中的 API。

com.amazonaws.services.glue

Scala 库中的 com.amazonaws.services.glueAmazon Glue 程序包包含以下 API:

com.amazonaws.services.glue.ml

Amazon Glue Scala 库中的 com.amazonaws.services.glue.ml 程序包包含以下 API:

com.amazonaws.services.glue.types

Scala 库中的 com.amazonaws.services.glue.typesAmazon Glue 程序包包含以下 API:

com.amazonaws.services.glue.util

Scala 库中的 com.amazonaws.services.glue.utilAmazon Glue 程序包包含以下 API:

MappingSpec

程序包:com.amazonaws.services.glue

MappingSpec case 类

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 对象具有以下成员:

Val 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