プライマリ・コンテンツに移動
Oracle® Big Data Connectorsユーザーズ・ガイド
リリース4 (4.12)
E98569-04
目次へ移動
目次
索引へ移動
索引

前
次

8 Oracle R Advanced Analytics for Hadoopの使用

この章では、ビッグ・データに対するRのサポートについて説明します。内容は次のとおりです。

注意:

Oracle R Advanced Analytics for Hadoopの旧名称は、Oracle R Connector for Hadoop (ORCH)です。ORCHという表記は、下位互換性のためにこのドキュメントおよび製品で引き続き使用されています。

8.1 Oracle R Advanced Analytics for Hadoopについて

Oracle R Advanced Analytics for Hadoopには、次のものが用意されています。

  • 汎用計算フレームワーク。このフレームワークでは、R言語を使用してカスタム・ロジックをマッパーまたはリデューサとして記述できます。コードは、Hadoopクラスタで使用可能な計算リソースとストレージ・リソースを使用する分散並列方式で実行されます。

  • Hive表を操作するためのRインタフェース。これはOracle R Enterpriseの透過レイヤーと似ていますが、いくつかの機能が制限されています。

  • パラレルに分散された事前パッケージ済のアルゴリズム・セット。

  • Apache Sparkのサポート。YARNを使用してSparkクラスタを動的に形成するHadoopクラスタ上、または専用のスタンドアロンのSparkクラスタ上で、予測分析関数を実行できます。Sparkの実行は、spark.connect()およびdisconnect() functions.関数を使用して切り替えられます。

  • Sparkを使用してニューラル・ネットワーク分析関数(orch.neural)を実行する機能。これによりMapReduceの実行の全体に渡ってパフォーマンスを大幅に改善します。

8.1.1 Oracle R Advanced Analytics for Hadoopアーキテクチャ

Oracle R Advanced Analytics for Hadoopの説明は次のとおりです。

  • Hadoopディストリビューションの一部であるユーティリティHadoop Streaming上に構築され、任意の実行可能ファイルまたはスクリプトをマッパーまたはリデューサとするMapジョブまたはReduceジョブの作成および実行を可能にします。

  • クライアント・サーバー構成でHadoopクラスタを使用するRユーザー用に設計されています。クライアント構成は、Oracle R Advanced Analytics for HadoopがデプロイされているHadoopディストリビューションの要件に従う必要があります。

  • HDFSおよびHIVEがクライアント・ノードからHadoopクラスタに対して通信を行うためにコマンドライン・インタフェースを使用します。

  • Rで記述されたユーザー提供のマッパー関数およびリデューサ関数によって簡単に処理できるように、データの入力ストリームをRデータ・フレーム・オブジェクトに変換するために必要なロジックを作成します。

  • Sqoopユーティリティを使用して、RユーザーがOracleのデータベース表またはビューのデータを、HDFSファイルとしてHadoopに移動できます。同様に、移動するデータ・サイズおよびセキュリティ要件に応じてSqoopユーティリティまたはOracle Loader for Hadoopユーティリティを使用して、データをHDFSファイルからOracle Databaseに戻すことができます。

  • パフォーマンスを重視する分析ワークロードで、入力および出力でRのバイナリRData表現をサポートします。区切り表現とRData表現との間の変換ユーティリティはOracle R Advanced Analytics for Hadoopの一部として使用できます。

  • 様々なHadoopディストリビューション間での類似性および違いを管理するHadoop Abstraction Layer (HAL)を含みます。ORCHは、起動時にHadoopバージョンを自動検出します。

8.1.2 Oracle R Advanced Analytics for Hadoopパッケージおよび関数

Oracle R Advanced Analytics for Hadoopには、Rパッケージのコレクションが組み込まれており、次の機能を提供します。

  • 次の要素を使用するためのインタフェース:

    • Apache Hive表

    • Apache Hadoop計算インフラストラクチャ

    • ローカルなR環境

    • Oracle Database表

    • 独自のバイナリRData表現

    • Apache SparkのRDDオブジェクト

  • 次の要素に対する予測分析手法:

    • 線形回帰

    • 一般化線形モデル

    • ニューラル・ネットワーク

    • 低ランクの行列因数分解モデルを使用した行列補完

    • Non-Negative Matrix Factorization

    • k-Meansクラスタリング

    • 主要コンポーネント分析

    • 多変量分析

    ORAAH 2.6には、Sparkでのフル・スタックの予測モデリング・アルゴリズムが導入されています。線形モデル技術(線形回帰、LASSO、リッジ回帰)に加えてGLM、SVM、k-Means、ガウス混合クラスタリング、決定木、ランダムフォレストおよび勾配ブースティング・ツリー、PCAおよびSVDなど、多くのSpark MLlibの機能が統合されています。既存のORAAHのSparkのカスタムアルゴリズムは、LMおよびGLMの両方に対する線形モデルおよびステップワイズ機能が加わり、強化されています。

    これらの手法にはRインタフェースがありますが、Oracle R Advanced Analytics for Hadoopでは、このインタフェースをJavaまたはRで分散並列MapReduceジョブとして実装しているため、クラスタのすべてのノードを活用できます。

このパッケージは、他のRパッケージと同様にインストールしてロードします。簡単なR関数を使用して、次のようなタスクを実行できます。

  • Hive対応透過層を使用したHDFSデータへのアクセスとデータの変換

  • マッパーとリデューサを記述するためのR言語の使用

  • Rメモリー、ローカル・ファイル・システム、HDFS、HiveおよびOracle Databaseインスタンスの間でデータをコピーします。

  • RからHiveデータを透過的に操作します。

  • Hadoop MapReduceジョブとしてRプログラムを実行し、それらの場所に結果を返します。

    • Oracle R Advanced Analytics for Hadoopを使用すると、非クラスタ(ローカル)実行とHadoopクラスタ実行の両方で、MapReduceジョブをRから発行できます。

    • Oracle R EnterpriseとOracle R Advanced Analytics for Hadoopをデータベース・サーバーで一緒に使用する場合、DBMS_SCHEDULERを使用して、ORCH関数を含むスクリプトを実行するようにデータベース・ジョブをスケジュールできます。

Oracle R Advanced Analytics for Hadoopを使用するには、MapReduceプログラミング、Rプログラミングおよび統計手法をよく理解しておく必要があります。

8.1.3 Oracle R Advanced Analytics for HadoopのAPI

Oracle R Advanced Analytics for Hadoopでは、次の接頭辞の関数を使用して、ローカルRクライアントからApache Hadoopへのアクセスを提供します。

  • hadoop: Hadoop MapReduceへのインタフェースを提供する関数を特定します。

  • hdfs: HDFSへのインタフェースを提供する関数を特定します。

  • orch: 様々な関数を特定します。orchORCH関数の一般的な接頭辞です。

  • ore: Hiveデータストアへのインタフェースを提供する関数を特定します。

Oracle R Advanced Analytics for Hadoopは、主なオブジェクト・タイプとしてデータ・フレームを使用しますが、HDFSとのデータ交換を行うためにベクトルや行列でも機能できます。APIは、Rの数字、整数および文字のデータ型をサポートします。

APIのすべてがORCHライブラリに含まれます。関数については、「Oracle R Advanced Analytics for Hadoop関数」を参照してください。

関連項目:

RプロジェクトのWebサイト(http://www.r-project.org/)

8.1.4 Oracle R Advanced Analytics for Hadoopへの入力

Oracle R Advanced Analytics for Hadoopでは、HDFSディレクトリ、HIVE表、またはデータのバイナリRData表現に存在するデリミタ付きテキスト・ファイルを操作できます。Oracle R Advanced Analytics for Hadoopが編成するマップの少ない計算に対する入力データがHDFSに存在しない場合、計算を起動する前にデータのコピーがHDFSに自動的に作成されます。

Oracle R Advanced Analytics for Hadoopがデリミタ付きテキスト・ファイルを処理できるようにするには、そのファイルに関連付けられているメタデータを判別し、データ・ファイルとともに格納されているファイルのメタデータを取得します。ファイルは__ORCHMETA__という名前になります。メタデータには次のような情報が含まれています。

  • ファイルにキーが含まれている場合は、キー区切りであるデリミタ

  • 値区切りであるデリミタ

  • ファイル内の列の番号および列のデータ型

  • 列のオプションの名前

  • 分類列のディクショナリ情報

  • その他のOracle R Advanced Analytics for Hadoop固有のシステム・データ

Oracle R Advanced Analytics for Hadoopは、メタデータ・ファイルを作成するためにhdfs.attach()呼び出しの一部としてHDFSオブジェクトで自動メタデータ検出手順を実行します。HIVE表を操作するとき、__ORCHMETA__ファイルがHIVE表のdefinition2から自動的に作成されます。

Oracle R Advanced Analytics for Hadoopは、I/Oパフォーマンスのために、入力データをオプションでRのバイナリRData表現に変換できます。このI/Oパフォーマンスは純粋にJavaベースのマップ削減実装と同等になります。

Oracle R Advanced Analytics for HadoopはHDFSファイルから行ストリームを取得し、それらをデータ・フレーム・オブジェクト(または、RData表現が使用されている場合は、オプションでデータ・フレーム・オブジェクトから生成した、またはそのままのマトリックス・オブジェクト、ベクトル・オブジェクトまたはリスト・オブジェクト)としてフォーマットして、Rで記述されたマップ済関数に提供します。こうするためには、Oracle R Advanced Analytics for Hadoopは、データ・フレームの列になるトークン・タイプおよびデータ型を認識する必要があります。Oracle R Advanced Analytics for Hadoopは、Rの機能を使用して入力行ストリームのトークンを解析および解釈します。欠落した値がRの"NA"トークンを使用して表現されていない場合、hdfs.attach()のna.strings引数で明示的に識別できます。

同じキー区切りおよび値区切りのデリミタ付きテキスト・ファイルは、別のキー区切りおよび値区切りを持つファイルより優先されます。同じキー区切りおよび値区切りを持つファイルの読取りパフォーマンスは、異なるキー区切りおよび値区切りを持つファイルの約2倍の速さです。

キー区切りおよび値区切りは、hdfs.attach()のkey.sep引数およびval.sep引数を使用して指定するか、または出力HDFSデータ用のMapReduceジョブの実行時に指定できます。

バイナリRData表現は、Oracle R Advanced Analytics for Hadoopの入力データの最もパフォーマンス効率の高い表現です。可能であれば、パフォーマンスが重要な分析にはこのバイナリ・データ表現の使用をお薦めします。

8.2 HDFSファイルへのアクセス

HDFSに格納されるデータにOracle R Advanced Analytics for Hadoopがアクセスするには、入力ファイルが次の要件に従う必要があります。

  • MapReduceジョブの入力ファイルはすべて、1つの論理ファイルの一環として1つのディレクトリに格納される必要があります。有効なHDFSディレクトリ名とファイル名の拡張子が受け入れられます。

  • 該当ディレクトリ内の、アンダースコア(_)で始まる名前のファイルは無視されます。

デリミタはすべてサポートされており、キーと値のデリミタは異なってもかまいません。

また、最高のI/Oパフォーマンスを実現するために、RからのRdata表現を使用してデリミタ付きファイルをバイナリ形式に変換できます。

8.3 Apache Hiveへのアクセス

Apache Hiveは、HiveQLと呼ばれる問合せ言語(SQLとよく似ている)によって、代替のストレージおよび取得メカニズムをHDFSファイルに提供します。Hiveでは、分散処理にMapReduceが使用されます。ただし、データは構造化され、データ検出をサポートする追加のメタデータがあります。Oracle R Advanced Analytics for HadoopではHiveQLのデータ準備と分析機能が使用されますが、R言語構文も使用できます。

8.3.1 HiveのORCH関数

ORCHでは、次の変換関数を提供しており、HDFSとHive間のデータ移動が簡単にできます。

hdfs.toHive
hdfs.fromHive

8.3.2 HiveのORE関数

接頭辞にoreが付くR関数(ore.connectなど)を使用して、Hiveへ接続し、Hive表オブジェクトを分析および変換できます。Oracle R Enterpriseも使用している場合は、これらの関数を認識します。Oracle R Enterpriseのore関数は、Oracle Databaseでオブジェクトを作成して管理し、Oracle R Advanced Analytics for Hadoopのore関数は、Hiveデータベースでオブジェクトを作成して管理します。一度に1つのデータベース(HiveまたはOracle Databaseのいずれか)に接続できますが、同時に両方のデータベースに接続することはできません。

注意:

Oracle R Enterpriseを設定および使用するための要件と手順の詳細は、Oracle R Enterpriseライブラリ(https://docs.oracle.com/cd/E83411_01/index.htm)を参照してください。

たとえば、ore.connect(type="HIVE")は、デフォルトのHIVE database.ore.hiveOptions(dbname='dbtmp')との接続を確立し、デフォルト・データベースを変更できるようにします。一方、ore.showHiveOptions()は、現在のデフォルトのHIVEデータベースの検査を可能にします。

OREのas.ore.*関数とis.ore.*関数のリストは、表8-7を参照してください。

8.3.3 Hiveでサポートされる一般的なR関数

Oracle R Advanced Analytics for Hadoopは、次のメソッドを含む標準汎用R関数もオーバーロードしてHiveオブジェクトを操作します。

文字メソッド

casefoldchartrgsubncharsubstrsubstringtolowertoupper

このリリースでは、greplsubはサポートされません。

フレーム・メソッド
  • attachshow

  • [, $, $<-, [[, [[<-

  • サブセット関数: headtail

  • メタデータ関数: dimlengthNROWnrowNCOLncolnamesnames<-colnamescolnames<-

  • 変換関数: as.data.frameas.envas.list

  • 算術演算子: +-*^%%%/%/

  • CompareLogicxor!

  • テスト関数: is.finiteis.infiniteis.nais.nan

  • 数学的変換: absacosasinatanceilingcosexpexpm1floorloglog10log1plog2logbroundsignsinsqrttantrunc

  • 基礎統計: colMeanscolSumsrowMeansrowSumsSummarysummaryunique

  • bymerge

  • unlistrbindcbinddata.frameeval

このリリースでは、dimnamesinteractionmax.colrow.namesrow.names<-scalesplitsubsettransformwithまたはwithinはサポートされません。

論理メソッド

ifelseLogicxor!

行列メソッド

サポートされません。

数値メソッド
  • 算術演算子: +-*^%%%/%/

  • テスト関数: is.finiteis.infiniteis.nan

  • absacosasinatanceilingcosexpexpm1floorloglog1plog2log10logbmeanroundsignsinsqrtSummarysummarytantrunczapsmall

このリリースでは、atan2besselIbesselKbesselJbesselYdifffactoriallfactorialpmaxpminまたはtabulateはサポートされません。

ベクトル・メソッド
  • showlengthc

  • テスト関数: is.vectoris.nan

  • 変換関数: as.vectoras.characteras.numericas.integeras.logical

  • [[<-|

  • byComparehead%in%pastesorttabletailtapplyunique

このリリースでは、interactionlengthbrankまたはsplitはサポートされません。

次の例に、簡単なデータ準備とデータ処理を示します。

例8-1 Rを使用したHive表のデータの処理

# Connect to Hive
ore.connect(type="HIVE")

# Attach the current envt. into search path of R
ore.attach()

# create a Hive table by pushing the numeric columns of the iris data set
IRIS_TABLE <- ore.push(iris[1:4])

# Create bins based on Petal Length
 IRIS_TABLE$PetalBins = ifelse(IRIS_TABLE$Petal.Length < 2.0, "SMALL PETALS",
+                        ifelse(IRIS_TABLE$Petal.Length < 4.0, "MEDIUM PETALS",
+                        ifelse(IRIS_TABLE$Petal.Length < 6.0,
+                               "MEDIUM LARGE PETALS", "LARGE PETALS")))

#PetalBins is now a derived column of the HIVE object
> names(IRIS_TABLE)
[1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "PetalBins"   

# Based on the bins, generate summary statistics for each group
aggregate(IRIS_TABLE$Petal.Length, by = list(PetalBins = IRIS_TABLE$PetalBins),
+           FUN = summary)
1        LARGE PETALS    6 6.025000 6.200000 6.354545 6.612500  6.9    0
2 MEDIUM LARGE PETALS    4 4.418750 4.820000 4.888462 5.275000  5.9    0
3       MEDIUM PETALS    3 3.262500 3.550000 3.581818 3.808333  3.9    0
4        SMALL PETALS    1 1.311538 1.407692 1.462000 1.507143  1.9    0
Warning message:
ORE object has no unique key - using random order 

8.3.4 Hiveデータ型のサポート

Oracle R Advanced Analytics for Hadoopは、tinyintsmallintbigintintfloatおよびdoubleなどの文字列や数値のデータ型の列を含むHive表にアクセスできます。

次の複雑なデータ型はサポートされません。

array
binary
map
struct
timestamp
union

サポートされないデータ型を含むHive表にアクセスしようとすると、エラー・メッセージが表示されます。表にアクセスするには、サポートされるデータ型に列を変換する必要があります。

サポートされるデータ型への列の変換するには、次の手順を実行します。

  1. Hiveコマンド・インタフェースを開きます。

    $ hive
    hive>
    
  2. サポートされないデータ型の列を特定します。

    hive> describe table_name;
    
  3. 列のデータを表示します。

    hive> select column_name from table_name;
    
  4. サポートされるデータ型のみを使用して、変換されたデータの表を作成します。

  5. 適切な変換ツールを使用して、データを新しい表にコピーします。

次に示す最初の例は、配列の変換を示します。他の2つの例は、タイムスタンプ・データの変換を示します。

例8-2 文字列の列への配列の変換

R> ore.sync(table="t1")
   Warning message:
   table t1 contains unsupported data types 
     .
     .
     .
hive> describe t1;
OK
      col1   int
      col2   array<string>

hive> select * from t1;
OK
1      ["a","b","c"]
2      ["d","e","f"]
3      ["g","h","i"]

hive> create table t2 (c1 string, c2 string, c2 string);
hive> insert into table t2 select col2[0], col2[1], col2[2] from t1;
     .
     .
     .
R> ore.sync(table="t2")
R> ore.ls()
[1] "t2"
R> t2$c1
[1] "a" "d" "g" 

次の例では、timestampデータ型の文字列への自動変換が使用されます。データは、tstmpという列があるt5という表に格納されます。

例8-3 タイムスタンプ列の変換

hive> select * from t5;


hive> create table t6 (timestmp string); 
hive> insert into table t6 SELECT tstmp from t5;
 

次の例では、Hiveのget_json_object関数を使用して、JSON表からOracle R Advanced Analytics for Hadoopで使用する個別の表に、関連する2つの列を抽出します。

例8-4 JSONファイルのタイムスタンプ列の変換

hive> select * from t3;
OK
      {"custId":1305981,"movieId":null,"genreId":null,"time":"2010-12-30:23:59:32","recommended":null,"activity":9}

hive> create table t4 (custid int, time string);
 
hive> insert into table t4 SELECT cast(get_json_object(c1, '$.custId') as int), cast(get_json_object(c1, '$.time') as string) from t3;

8.3.5 Hiveアクセスの使用上の注意

Hiveコマンド言語インタフェース(CLI)は問合せの実行に使用され、Linuxクライアントのサポートを提供します。JDBCやODBCはサポートされません。

ore.create関数は、Hive表をテキスト・ファイルのみで作成します。ただし、Oracle R Advanced Analytics for Hadoopは、テキスト・ファイルまたは順序ファイルのいずれかで格納されるHive表にアクセスできます。

ore.exec関数を使用して、RコンソールからHiveコマンドを実行できます。デモの場合、hive_sequencefileデモを実行します。

Oracle R Advanced Analytics for Hadoopは、デフォルトのHiveデータベースのみの表とビューにアクセスできます。他のデータベースのオブジェクトに対する読取りアクセス権を許可するには、デフォルトのデータベースでそのオブジェクトを公開する必要があります。たとえば、ビューを作成できます。

Oracle R Advanced Analytics for Hadoopには、Hiveでの順序付けの概念がありません。Hiveで存続するRフレームがHiveから抜け出してメモリーに入ると、そのフレームの順序は同じになりません。Oracle R Advanced Analytics for Hadoopは、順序付けが重要ではない大規模なHDFSデータセットのデータのクリーン・アップとフィルタ処理のサポートを主な目的として設計されています。順序付けられていないHiveフレームを操作する場合、次の警告メッセージが表示されます。

Warning messages:
1: ORE object has no unique key - using random order 
2: ORE object has no unique key - using random order 

これらの警告を抑制するには、次のようにRセッションでore.warn.orderオプションを設定します。

R> options(ore.warn.order = FALSE)

8.3.6 例: Oracle R Advanced Analytics for HadoopへのHive表のロード

次の例に、分析目的でRデータ・フレームにHive表をロードする例を示します。次のOracle R Advanced Analytics for Hadoop関数が使用されます。

hdfs.attach
ore.attach
ore.connect
ore.create
ore.hiveOptions
ore.sync

例8-5 Hive表のロード

# Connect to HIVE metastore and sync the HIVE input table into the R session.
ore.connect(type="HIVE")
ore.sync(table="datatab")
ore.attach()
 
# The "datatab" object is a Hive table with columns named custid, movieid, activity, and rating.
# Perform filtering to remove missing (NA) values from custid and movieid columns 
# Project out three columns: custid, movieid and rating
t1 <- datatab[!is.na(datatab$custid) &
    !is.na(datatab$movieid) & 
    datatab$activity==1, c("custid","movieid", "rating")]
 
# Set HIVE field delimiters to ','. By default, it is Ctrl+a for text files but
# ORCH 2.0 supports only ',' as a file separator.
ore.hiveOptions(delim=',')

# Create another Hive table called "datatab1" after the transformations above.
ore.create (t1, table="datatab1")
 
# Use the HDFS directory, where the table data for datatab1 is stored, to attach
# it to ORCH framework. By default, this location is "/user/hive/warehouse"
dfs.id <- hdfs.attach("/user/hive/warehouse/datatab1")

# dfs.id can now be used with all hdfs.*, orch.* and hadoop.* APIs of ORCH for further processing and analytics.

8.4 Oracle Databaseへのアクセス

Oracle R Advanced Analytics for Hadoopは、基本レベルのデータベース・アクセスを提供します。データベース表の内容をHDFSに移動したり、HDFS分析の結果をデータベースに戻したりすることができます。

その後、Oracle R Enterpriseという個別の製品を使用して、この小規模データセットに対してさらに分析を実行できます。この製品を使用すると、R言語を使用して、データベースの表、ビューおよびその他のデータ・オブジェクトに統計分析を実行できます。Business Intelligenceおよびインデータベース分析のサポートを含む、データベース・オブジェクトへの透過的なアクセス権があります。

Oracle Databaseに格納されるデータへのアクセスは、常にDBAから付与されるアクセス権に制限されます。

Oracle R Enterpriseは、Oracle Database Enterprise EditionへのOracle Database Advanced Analyticsオプションに含まれています。Oracle Big Data Connectorsには含まれていません。

関連項目:

Oracle R Enterpriseユーザーズ・ガイド

8.4.1 Oracle Databaseアクセスの使用上の注意

Oracle R Advanced Analytics for Hadoopは、Sqoopを使用して、HDFSとOracle Database間でデータを移動します。Sqoopは、Oracle R Advanced Analytics for Hadoopに対して次のような複数の制限を設けます。

  • BINARY_FLOAT列またはBINARY_DOUBLE列を含むOracle表はインポートできません。回避策として、これらの列の型をNUMBERデータ型に変換するビューを作成できます。

  • 列名はすべて大文字にする必要があります。

8.4.2 Oracle R EnterpriseでOracle R Advanced Analytics for Hadoopを使用する場合のシナリオ

次のシナリオで、Oracle R Advanced Analytics for HadoopとOracle R Enterpriseを使用するケースを確認してください。

Oracle R Advanced Analytics for Hadoopを使用すると、アクセス権を持つファイルをHDFS上で検索して、そのうち1つのファイルのデータに対してR計算を実行できます。また、ローカル・ファイル・システムのテキスト・ファイルに格納されているデータを計算用にHDFSにアップロードし、DBMS_SCHEDULERを使用してRスクリプトをHadoopクラスタで実行するようスケジュールして、結果をローカル・ファイルにダウンロードできます。

Oracle R Enterpriseを使用すると、Rインタフェースを開いてOracle Databaseに接続し、データベースの権限に基づいて使用可能になる表とビューを操作できます。行の除外、導出された列の追加、新しい列の投影および視覚的で統計的な分析を行うことができます。

Oracle R Advanced Analytics for Hadoopを使用すると、Rで記述されたCPU負荷の高い計算の場合、MapReduceジョブをHadoopにデプロイできます。計算には、HDFS (Oracle R Enterpriseを含む)またはOracle Databaseに格納されているデータを使用できます。計算の結果をOracle DatabaseやRコンソールに返し、ビジュアル化したり、追加処理を行うことができます。

8.5 Oracle R Advanced Analytics for Hadoop関数

Oracle R Advanced Analytics for Hadoop関数の説明は、Rヘルプ・トピックを参照してください。この項では、各関数を機能カテゴリに分類し、簡単に説明します。

8.5.1 ネイティブ分析関数

次の表にネイティブ分析関数を示します。

表8-1 統計分析用の関数

関数 説明

orch.cor

Pearsonの相関係数の相関行列を生成します。

orch.cov

共分散行列を生成します。

orch.getXlevels

model.matrix呼出しのxlev引数で使用できる因数レベルのリストを作成します。統計パッケージの.getXlevels関数と同等です。

orch.glm

HDFSに格納されているデータに対して、汎用線形モデルを適合させて使用します。

orch.kmeans

HDFSにファイルとして格納されているデータ行列に対してK平均法クラスタリングを実行します。

orch.lm

tall-and-skinny QR (TSQR)因数分解と並列分散を使用して線形モデルを調整します。この関数は、 Oracle R Enterpriseのore.lm関数と同じ統計パラメータを計算します。

orch.lmf

jellyfishアルゴリズム、またはMahout alternating least squares with weighted regularization (ALS-WR)アルゴリズムを使用して、低ランクの行列因数分解モデルを調整します。

orch.neural

入力と出力の間の複雑な非線形の関係をモデル化したり、データのパターンを見つけたりするニューラル・ネットワークを提供します。

orch.nmf

jellyfishアルゴリズムを使用して非負行列因子分解モデルを作成する主なエントリ・ポイントを提供します。この関数は、入力をメモリーに収める必要がないため、RのNMFパッケージよりもかなり大規模なデータセットを操作できます。

orch.nmf.NMFalgo

RのNMFパッケージ・フレームワークをカスタム・アルゴリズムとして挿入します。この関数は、ベンチマーク・テストに使用されます。

orch.princomp

主コンポーネントのパフォーマンスを分析します。

orch.recommend

入力したorch.mahout.lmf.aslモデルに基づき、格付けが予想される各ユーザーに推奨される上位n個の項目を計算します。

orch.sample

貯蔵サンプリングを提供します。

orch.scale

スケーリングを実行します。

8.5.2 Hadoop Distributed File System (HDFS)の使用

次の表で、R環境内からHDFSコマンドを実行する関数について説明します。

表8-2 HDFSを使用するための関数

関数 説明

hdfs.cd

デフォルトのHDFSパスを設定します。

hdfs.cp

HDFSファイルを別の場所にコピーします。

hdfs.describe

HDFS内のファイルに関連付けられたメタデータを返します。

hdfs.exists

ファイルがHDFSに存在することを確認します。

hdfs.head

HDFS内のファイルの先頭から、指定した数の行をコピーします。

hdfs.id

HDFSパス名をRのdfs.idオブジェクトに変換します。

hdfs.ls

指定されたパス内のデータを含む全HDFSディレクトリの名前のリスト。

hdfs.mkdir

現在の作業ディレクトリに相対的なサブディレクトリをHDFS内に作成します。

hdfs.mv

HDFSファイルを別の場所に移動します。

hdfs.parts

HDFS内のファイルを構成する部分の数を返します。

hdfs.pwd

HDFS内の現在の作業ディレクトリを識別します。

hdfs.rm

HDFSからファイルまたはディレクトリを削除します。

hdfs.rmdir

HDFS内のディレクトリを削除します。

hdfs.root

HDFSのrootディレクトリを返します。

hdfs.setroot

HDFSのrootディレクトリを設定します。

hdfs.size

HDFS内のファイルのサイズを返します。

hdfs.tail

HDFS内のファイルの末尾から、指定された数の行をコピーします。

8.5.3 Apache Hiveの使用

次の表で、Hiveとともに使用するためにOracle R Advanced Analytics for Hadoopで使用可能な関数について説明します。

表8-3 Hiveを使用するための関数

関数 説明

hdfs.fromHive

ORCHでHive表をHDFS識別子に変換します。

hdfs.toHive

HDFSオブジェクト識別子をore.frameオブジェクトで表されるHive表に変換します。

ore.create

data.frameオブジェクトまたはore.frameオブジェクトからデータベース表を作成します。

ore.drop

データベース表またはビューを削除します。

ore.get

指定されたore.frameオブジェクトを取得します。

ore.pull

Hive表からRオブジェクトにデータをコピーします。

ore.push

RオブジェクトからHive表にデータをコピーします。

ore.recode

ore.vectorオブジェクトの値を置換します。

関連項目

8.5.4 Hiveでの集計関数の使用

次の表で、Hiveとともに使用するためにOracle R Advanced Analytics for HadoopでサポートされるOREstatsパッケージの集計関数について説明します。

表8-4 Oracle R Enterprise集計関数

関数 説明

aggregate

データをサブセットに分割し、サブセットごとに統計サマリーを計算します。

fivenum

入力データのTukeyの5数要約(最小値、下側ヒンジ、中央値、上側ヒンジ、最大値)を返します。

IQR

四分位範囲を計算します。

median

サンプル中央値を計算します。

quantile

指定された蓋然率に対応するサンプル変位値を生成します。

sd

標準偏差を計算します。

var脚注1

差異を計算します。

脚注1

ベクトルの場合のみ

8.5.5 データベース接続の確立

次の表で、Oracle Databaseへの接続を確立するための関数について説明します。

表8-5 Oracle Databaseを使用するための関数

関数 説明

orch.connect

Oracle Databaseへの接続を確立します。

orch.connected

Oracle R Advanced Analytics for HadoopがOracle Databaseに接続するかどうかを確認します。

orch.dbcon

認証資格証明を除く、Oracle Databaseへの現在の接続の接続オブジェクトを返します。

orch.dbinfo

現在の接続に関する情報を表示します。

orch.disconnect

ローカルRセッションをOracle Databaseから切断します。

orch.reconnect

orch.disconnectで以前に返された資格証明を使用してOracle Databaseに再接続します。

8.5.6 データのコピーおよびHDFSファイルの操作

次の表で、OracleデータベースのRデータ・フレーム、HDFSファイル、ローカル・ファイルおよび表を含め、プラットフォーム間でデータをコピーするための関数について説明します。

表8-6 データをコピーするための関数

関数 説明

hdfs.attach

HDFSの非構造化データ・ファイルのデータを、Rフレームワークにコピーします。デフォルトでは、HDFSのデータ・ファイルはコネクタで表示されません。ただし、データ・ファイルの名前がわかっている場合、この関数を使用して名前をOracle R Advanced Analytics for Hadoopネームスペースにアタッチします。

hdfs.download

HDFSからローカル・ファイル・システムにファイルをコピーします。

hdfs.get

HDFSからローカルR環境のデータ・フレームにデータをコピーします。R環境でデータが生成されると、すべてのメタデータが抽出され、列名やデータ型などのすべての属性がリストアされます。R環境でデータが生成されない場合、val1やval2などの汎用属性が割り当てられます。

hdfs.pull

HDFSからOracle Databaseにデータをコピーします。この操作は、Oracle Databaseによる認証が必要です。「orch.connect」を参照してください。

hdfs.push

Oracle DatabaseからHDFSにデータをコピーします。この操作は、Oracle Databaseによる認証が必要です。「orch.connect」を参照してください。

hdfs.put

Rのインメモリー・オブジェクト(data.frame)からHDFSにデータをコピーします。列名やデータ型などのすべてのデータ属性が、データとともにメタデータとして格納されます。

hdfs.sample

HadoopファイルからRインメモリー・オブジェクトにデータのランダム・サンプルをコピーします。この関数を使用して、最終的にはHadoopクラスタ上のHDFSデータセット全体で実行するR計算の開発用に、元のHDFSデータの小規模なサンプルをコピーします。

hdfs.upload

ローカル・ファイル・システムからHDFSにファイルをコピーします。

is.hdfs.id

Rオブジェクトに有効なHDFSファイル識別子が含まれるかどうかを示します。

8.5.7 Rデータ型への変換

次の表で、データ型の変換およびテスト用の関数について説明します。Oracle R EnterpriseのOREbaseパッケージには、次の関数が用意されています。

表8-7 データ型の変換およびテスト用の関数

関数 説明

as.ore

インメモリーRオブジェクトをOREオブジェクトにします。

as.ore.character

インメモリーRオブジェクトをORE文字オブジェクトにします。

as.ore.date

インメモリーRオブジェクトをORE日付オブジェクトにします。

as.ore.datetime

インメモリーRオブジェクトをORE日時オブジェクトにします。

as.ore.difftime

インメモリーRオブジェクトをORE時間差オブジェクトにします。

as.ore.factor

インメモリーRオブジェクトをORE因数オブジェクトにします。

as.ore.frame

インメモリーRオブジェクトをOREフレーム・オブジェクトにします。

as.ore.integer

インメモリーRオブジェクトをORE整数オブジェクトにします。

as.ore.list

インメモリーRオブジェクトをOREリスト・オブジェクトにします。

as.ore.logical

インメモリーRオブジェクトをORE論理オブジェクトにします。

as.ore.matrix

インメモリーRオブジェクトをORE行列オブジェクトにします。

as.ore.numeric

インメモリーRオブジェクトをORE数値オブジェクトにします。

as.ore.object

インメモリーRオブジェクトをOREオブジェクトにします。

as.ore.vector

インメモリーRオブジェクトをOREベクトル・オブジェクトにします。

is.ore

指定された値が特定のOracle R Enterpriseクラスのオブジェクトかどうかをテストします。

is.ore.character

指定された値が文字かどうかをテストします。

is.ore.date

指定された値が日付かどうかをテストします。

is.ore.datetime

指定された値が日時型かどうかをテストします。

is.ore.difftime

指定された値が時間差型かどうかをテストします。

is.ore.factor

指定された値が因数かどうかをテストします。

is.ore.frame

指定された値がフレームかどうかをテストします。

is.ore.integer

指定された値が整数かどうかをテストします。

is.ore.list

指定された値がリストかどうかをテストします。

is.ore.logical

指定された値が論理型かどうかをテストします。

is.ore.matrix

指定された値が行列かどうかをテストします。

is.ore.numeric

指定された値が数値かどうかをテストします。

is.ore.object

指定された値がオブジェクトかどうかをテストします。

is.ore.vector

指定された値がベクトルかどうかをテストします。

8.5.8 MapReduceの使用

次の表で、MapReduceプログラムの作成時や実行時に使用する関数について説明します。

表8-8 MapReduceを使用するための関数

関数 説明

hadoop.exec

Hadoopエンジンを起動し、実行用にマッパー、リデューサおよびコンバイナR関数を送信します。まず、データをHDFSにロードする必要があります。

hadoop.jobs

実行中のジョブをリストするため、Hadoopクラスタでの現在の負荷を評価できます。

hadoop.run

Hadoopエンジンを起動し、実行用にマッパー、リデューサおよびコンバイナR関数を送信します。データがまだHDFSに格納されていない場合、hadoop.runは、まずデータをHDFSにコピーします。

orch.dryrun

ローカル・ホストとHadoopクラスタ間で実行プラットフォームを切り替えます。ドライ・ランにRコードの変更は必要ありません。

orch.export

ユーザーのローカルRセッションのRオブジェクトをHadoop実行環境で利用できるようにするため、これらのオブジェクトをMapReduceジョブで参照できます。

orch.keyval

MapReduceジョブのキーと値のペアを出力します。

orch.keyvals

MapReduceジョブのキーと値の一連のペアを出力します。

orch.pack

マッパーまたはリデューサがキーと値のペアの値として記述する必要がある、1つ以上のインメモリーRオブジェクトを圧縮します。

orch.tempPath

一時データが格納されるパスを設定します。

orch.unpack

前述のorch.packの呼出しで圧縮されたRオブジェクトをリストアします。

orch.create.parttab

パーティション化Hive表をORCH MapReduceフレームワークとともに使用できるようにします。

8.5.9 スクリプトのデバッグ

次の表に、Rプログラム・スクリプトのデバッグの支援に使用できる関数を示します。

表8-9 スクリプトのデバッグ用の関数

関数 説明

orch.dbg.lasterr

最後のエラー・メッセージを返します。

orch.dbg.off

デバッグ・モードを無効にします。

orch.dbg.on

デバッグ・モードを有効にします。これにより、Rコマンドを含むHadoopとOracle R Advanced Analytics for Hadoopとの間のやりとりを出力します。

orch.dbg.output

デバッガからの出力を管理します。

orch.version

ORCHパッケージのバージョンを識別します。

orch.debug

MapReduce RスクリプトのR形式のデバッグを可能にします。

8.6 Oracle R Advanced Analytics for Hadoop関数のデモ

Oracle R Advanced Analytics for Hadoopには、様々なデモが用意されており、他のRデモと同じ方法でアクセスできます。

demo関数により、ORCHで使用可能な関数がリストされます。

R>  demo(package="ORCH")
Demos in package 'ORCH':
 
hdfs_cpmv               ORCH's copy and move APIs
hdfs_datatrans          ORCH's HDFS data transfer APIs
hdfs_dir                ORCH's HDFS directory manipulation APIs
hdfs_putget             ORCH's get and put API usage
hive_aggregate          Aggregation in HIVE
hive_analysis           Basic analysis & data processing operations
hive_basic              Basic connectivity to HIVE storage
hive_binning            Binning logic
hive_columnfns          Column function
hive_nulls              Handling of NULL in SQL vs. NA in R
     .
     .
     .

このリストからデモを実行するには、次の構文を使用します。

demo("demo_name", package="ORCH")

たとえば、このパッケージは、Hive binningのデモを実行します。

R> demo("hive_binning", package = "ORCH")
 
 
 demo('hive_binning', package = 'ORCH')
 
 
        demo(hive_binning)
        ---- ~~~~~~~~~~~~
 
> #
> #     ORACLE R CONNECTOR FOR HADOOP DEMOS
> #
> #     Name: hive_binning.R
> #     Description: Demonstrates binning logic in R
> #
> #
     .
     .
     .

エラーが発生した場合は、作業領域イメージを保存せずにRを終了し、新しいセッションを開始してください。また、ローカル・ファイル・システムおよびHDFSファイル・システムに作成された一時ファイルを削除する必要もあります。

# rm -r /tmp/orch*
# hdfs dfs -rm -r /tmp/orch*

完了したら、次のようにします。

  1. hadoop.execを実行して、すべての空のpartファイルおよびHadoopログ・ファイルをクリーン・アップまたは削除します。

  2. hadoop.runを実行して、同じ名前でのHDFSオブジェクトの上書きを許可します。

8.7 Oracle R Advanced Analytics for Hadoopのセキュリティ上の注意

Oracle R Advanced Analytics for Hadoopでは、Sqoopユーティリティを起動してOracle Databaseに接続し、データの抽出または結果の格納を実行します。

Sqoopは、HDFSまたはHiveと構造化データベースとの間でデータのインポートとエクスポートを行うHadoopのコマンドライン・ユーティリティです。Sqoopという名前は、"SQL to Hadoop"に由来します。Oracle R Advanced Analytics for Hadoopでのデータベース・ユーザー・パスワードの格納方法とSqoopへの送信方法について、次に説明します。

Oracle R Advanced Analytics for Hadoopでは、毎回パスワードを再入力する必要のないモードでユーザーがデータベース接続を確立した場合にのみユーザー・パスワードを格納します。パスワードは暗号化されてメモリーに格納されます。orch.connectについては、ヘルプ・トピックを参照してください。

Oracle R Advanced Analytics for Hadoopでは、Sqoop用の構成ファイルを生成し、Sqoopのローカルでの起動に使用します。ファイルには、ユーザーへの要求または暗号化されたインメモリー表現から取得されたユーザーのデータベース・パスワードが含まれます。ファイルは、ローカル・ユーザー・アクセス権限のみ持ちます。ファイルが作成され、権限が明示的に設定された後、ファイルが書込み用に開かれ、データが挿入されます。

Sqoopでは、構成ファイルを使用して特定のデータベース・ジョブ用にカスタムJARファイルを動的に生成し、JARファイルをHadoopクライアント・ソフトウェアに渡します。パスワードは、コンパイルされたJARファイル内に格納されます。プレーン・テキストには格納されません。

JARファイルは、ネットワーク接続を介してHadoopクラスタに転送されます。ネットワーク接続と転送プロトコルは、Hadoopに固有です(ポート5900など)。

構成ファイルは、SqoopでJARファイルのコンパイルが終了し、Hadoopジョブが起動されたら、削除されます。

8.8 ORAAHのサードパーティ・ライセンス

Oracle R Advanced Analytics for Hadoopは、次のサードパーティ製品に依存しています。

8.8.1 ANTLR 4.7

Copyright (c) 2015 Terence Parr, Sam Harwell

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

8.8.2 Scala 12.11.11

http://www.scala-lang.org/license.html

Copyright (c) 2002-2013 EPFL
 Copyright (c) 2011-2013 Typesafe, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
• Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

8.8.3 Scala 12.11.12

https://github.com/scala/scala/blob/2.11.x/doc/LICENSE.md

Scala License
Copyright (c) 2002-2018 EPFL
Copyright (c) 2011-2018 Lightbend, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the EPFL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The following third party code may be included in the distribution as part of Scala:
Apache 2.0  License
This license is used by the following third-party libraries:
-- jansi
-- akka
-- ant
BSD License
This license is used by the following third-party libraries:
-- jline
BSD 3-Clause License
This license is used by the following third-party libraries:
-- asm
MIT License
This license is used by the following third-party libraries:
-- jquery
-- jquery-ui
-- jquery-layout
-- sizzle
-- tools tooltip
Public Domain
The following libraries are freely available in the public domain:
-- forkjoin
____________
jline BSD License
---------------------
https://github.com/jline/jline3/blob/master/LICENSE.txt

Copyright (c) 2002-2018, the original author or authors.
All rights reserved.

http://www.opensource.org/licenses/bsd-license.php

Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:

Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with
the distribution.

Neither the name of JLine nor the names of its contributors
may be used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

ASM
https://asm.ow2.io/license.html

ASM: a very small and fast Java bytecode manipulation framework
Copyright (c) 2000-2011 INRIA, France Telecom
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.

jquery, sizzle, tooltip MIT License
------------------------------------------
https://github.com/jquery/jquery/blob/master/LICENSE.txt
https://github.com/jquery/sizzle/blob/master/LICENSE.txt
Copyright JS Foundation and other contributors, https://js.foundation/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

_______________
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS



8.8.4 MPICH 3.3a2

 COPYRIGHT
   3 
   4 The following is a notice of limited availability of the code, and disclaimer
   5 which must be included in the prologue of the code and in all source listings
   6 of the code.
   7 
   8 Copyright Notice
   9  + 2002 University of Chicago
  10 
  11 Permission is hereby granted to use, reproduce, prepare derivative works, and
  12 to redistribute to others.  This software was authored by:
  13 
  14 Mathematics and Computer Science Division
  15 Argonne National Laboratory, Argonne IL 60439
  16 
  17 (and)
  18 
  19 Department of Computer Science
  20 University of Illinois at Urbana-Champaign
  21 
  22 
  23                               GOVERNMENT LICENSE
  24 
  25 Portions of this material resulted from work developed under a U.S.
  26 Government Contract and are subject to the following license: the Government
  27 is granted for itself and others acting on its behalf a paid-up, nonexclusive,
  28 irrevocable worldwide license in this computer software to reproduce, prepare
  29 derivative works, and perform publicly and display publicly.
  30 
  31                                   DISCLAIMER
  32 
  33 This computer code material was prepared, in part, as an account of work
  34 sponsored by an agency of the United States Government.  Neither the United
  35 States, nor the University of Chicago, nor any of their employees, makes any
  36 warranty express or implied, or assumes any legal liability or responsibility
  37 for the accuracy, completeness, or usefulness of any information, apparatus,
  38 product, or process disclosed, or represents that its use would not infringe
  39 privately owned rights.