これらの関数は、http://xmlns.oracle.com/hadoop/xquery
ネームスペースにあります。oxh
接頭辞は事前に宣言され、モジュールは自動的にインポートされます。
Hadoopモジュールについては、次のトピックを参照してください。
Hadoop関数
Oracle XQuery for Hadoopには、次の関数が組み込まれています。
パターンに一致する一連のファイル・パスを返します。
シグネチャ
oxh:find($pattern as xs:string?) as xs:string*
パラメータ
$pattern
: 検索するファイル・パターン
関連項目: ファイル・パターンについては、次のサイトにある『Apache Hadoop API』のglobStatus メソッドに関する項
|
ユーザー定義のMapReduceジョブ・カウンタを増やします。デフォルトの増分は1です。
シグネチャ
oxh:increment-counter($groupName as xs:string, $counterName as xs:string, $value as xs:integer oxh:increment-counter($groupName as xs:string, $counterName as xs:string
パラメータ
$groupName
: このカウンタが属するカウンタ・グループ。
$counterName
: ユーザー定義カウンタの名前
$value
: カウンタを増やす量
Oracle XQuery for Hadoopクライアント・プロセスのstdout
にテキスト行を出力します。この関数は、問合せを開発しているときに使用します。
シグネチャ
declare %updating function oxh:println($arg as xs:anyAtomicType?)
パラメータ
$arg
: 出力に追加する値です。cast
操作は、最初にstring
に変換します。空の順序は空の文字列と同じ方法で扱われます。
例
この例では、data.txt
の値をstdout
に出力します。
for $i in text:collection("data.txt") return oxh:println($i)