AWS Glue Scala DynamicRecord 클래스
주제
패키지: com.amazonaws.services.glue
class DynamicRecord extends Serializable with Writable with Cloneable
DynamicRecord
는 진행된 데이터 세트의 데이터 행을 나타내는 자체적으로 설명되는 데이터 구조입니다. 기록 자체를 검사한 DynamicRecord
에 의해 보여지는 스키마 행을 얻을 수 있다는 의미에서 자체 설명적입니다. DynamicRecord
는 Apache Spark의 Row
와 유사합니다.
def addField
def addField( path : String,
dynamicNode : DynamicNode
) : Unit
지정된 경로로 DynamicNode를 추가합니다.
path
- 필드를 추가할 경로입니다.dynamicNode
- 지정된 경로에 추가될 DynamicNode입니다.
def dropField
def dropField(path: String, underRename: Boolean = false): Option[DynamicNode]
지정된 경로로부터 DynamicNode을 드롭하고 지정된 경로에 배열이 없으면 드롭된 노트를 반환합니다.
path
- 필드를 제거할 경로입니다.underRename
-dropField
가 이름 변경 변환의 일부로 호출되는 경우는 true이고, 아닌 경우는 false입니다(기본값은 false).
scala.Option Option
(DynamicNode)을 반환합니다.
def setError
def setError( error : Error )
error
파라미터에 의해 지정되어 이 기록을 오류 기록으로 설정합니다.
DynamicRecord
을 반환합니다.
def isError
def isError
이 기록이 오류 기록인지 확인합니다.
def getError
def getError
이 기록이 오류 기록이면 Error
를 얻습니다. 이 기록이 오류 기록이면 scala.Some Some
(오류)를 반환하고 그렇지 않으면 scala.None
입니다.
def clearError
def clearError
Error
을 scala.None.None
로 설정합니다.
def write
override def write( out : DataOutput ) : Unit
def readFields
override def readFields( in : DataInput ) : Unit
def clone
override def clone : DynamicRecord
이 레코드를 새 DynamicRecord
로 복제하고 반환합니다.
def schema
def schema
이 기록을 검사하여 Schema
를 얻습니다.
def getRoot
def getRoot : ObjectNode
이 레코드의 루트 ObjectNode
를 얻습니다.
def toJson
def toJson : String
이 레코드의 JSON 문자열을 얻습니다.
def getFieldNode
def getFieldNode( path : String ) : Option[DynamicNode]
DynamicNode
의 옵션으로 지정된 path
의 필드 값을 가져옵니다.
필드가 존재하는 경우 scala.Some Some
(DynamicNode)을 반환하고, 그렇지 않으면 scala.None.None
입니다.
def getField
def getField( path : String ) : Option[Any]
DynamicNode
의 옵션으로 지정된 path
의 필드 값을 가져옵니다.
scala.Some Some
(값)을 반환합니다.
def hashCode
override def hashCode : Int
def equals
override def equals( other : Any )
DynamicRecord 객체
object DynamicRecord
정의 적용
def apply( row : Row,
schema : SparkStructType )
Apache Spark SQL Row
를 DynamicRecord로 변환하는 방법을 적용합니다.
row
- Spark SQLRow
.schema
- 행의Schema
입니다.
DynamicRecord
을 반환합니다.
RecordTraverser 특성
trait RecordTraverser {
def nullValue(): Unit
def byteValue(value: Byte): Unit
def binaryValue(value: Array[Byte]): Unit
def booleanValue(value: Boolean): Unit
def shortValue(value: Short) : Unit
def intValue(value: Int) : Unit
def longValue(value: Long) : Unit
def floatValue(value: Float): Unit
def doubleValue(value: Double): Unit
def decimalValue(value: BigDecimal): Unit
def stringValue(value: String): Unit
def dateValue(value: Date): Unit
def timestampValue(value: Timestamp): Unit
def objectStart(length: Int): Unit
def objectKey(key: String): Unit
def objectEnd(): Unit
def mapStart(length: Int): Unit
def mapKey(key: String): Unit
def mapEnd(): Unit
def arrayStart(length: Int): Unit
def arrayEnd(): Unit
}