カスタム入力変換を使用してScioでこれを行うことができます。通常、ネイティブのScioインタフェースを持たない入力ソースに対しては、これを行う必要があります。
例:https://beam.apache.org/documentation/sdks/javadoc/2.2.0/
:
import org.apache.beam.sdk.io.xml._
val xmlInputTransform = XmlIO.read()
.from("file or pattern spec") // TODO: specify file name or Java "glob" file pattern to read multiple XML files
.withRootElement("root element") // TODO: specify name of root element
.withRecordElement("record element") // TODO: specify name of record element
.withRecordClass(classOf[Record]) // TODO: Define JAXB annotated Record class
// xmls is an SCollection[Record]
val xmls = sc.customInput("fromXML", xmlInputTransform)
は、より多くの詳細については、ApacheのビームのJava SDKのリファレンスXmlIO.Read
セクションを参照してください