この記事では、CData JDBC Driver for ADLS をRapidMiner のプロセスと簡単に統合する方法を示します。この記事では、CData JDBC Driver for ADLS を使用してAzure Data Lake Storage をRapidMiner のプロセスに転送します。
RapidMiner のAzure Data Lake Storage にJDBC Data Source として接続する
以下のステップに従ってAzure Data Lake Storage へのJDBC 接続を確認できます。
- Azure Data Lake Storage 用の新しいデータベースドライバーを追加します。[Connections]->[Manage Database Drivers]とクリックします。
- 表示されるウィザードで[Add]ボタンをクリックし、接続に名前を入力します。
- JDBC URL のプレフィックスを入力します。
jdbc:adls:
- インストールディレクトリのlib サブフォルダにあるcdata.jdbc.adls.jar ファイルにパスを入力して下さい。
- ドライバークラスを入力します。
cdata.jdbc.adls.ADLSDriver
- 新しいAzure Data Lake Storage 接続を作成します。[Connections]->[Manage Database Connections]とクリックします。
- 接続の名前を入力します。
- データベースシステムの場合は、以前構成したAzure Data Lake Storage ドライバーを選択します。
- Host ボックスで接続文字列を入力します。
Authenticating to a Gen 1 DataLakeStore Account
Gen 1 uses OAuth 2.0 in Azure AD for authentication.
For this, an Active Directory web application is required. You can create one as follows:
- Sign in to your Azure Account through the
[.
]- Select "Azure Active Directory".
- Select "App registrations".
- Select "New application registration".
- Provide a name and URL for the application. Select Web app for the type of application you want to create.
- Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
- Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.
To authenticate against a Gen 1 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen1.
- Account: Set this to the name of the account.
- OAuthClientId: Set this to the application Id of the app you created.
- OAuthClientSecret: Set this to the key generated for the app you created.
- TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
Authenticating to a Gen 2 DataLakeStore Account
To authenticate against a Gen 2 DataLakeStore account, the following properties are required:
- Schema: Set this to ADLSGen2.
- Account: Set this to the name of the account.
- FileSystem: Set this to the file system which will be used for this account.
- AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
- Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.
ビルトイン接続文字列デザイナ
JDBC URL の構成については、Azure Data Lake Storage JDBC Driver に組み込まれている接続文字列デザイナを使用してください。JAR ファイルのダブルクリック、またはコマンドラインからJAR ファイルを実行します。
java -jar cdata.jdbc.adls.jar
接続プロパティを入力し、接続文字列をクリップボードにコピーします。
以下は一般的な接続文字列です。
Schema=ADLSGen2;Account=myAccount;FileSystem=myFileSystem;AccessKey=myAccessKey;InitiateOAuth=GETANDREFRESH
- 必要であればユーザー名とパスワードを入力します。
プロセス内の様々なRapidMiner オペレーターとのAzure Data Lake Storage 接続を使用できます。Azure Data Lake Storage を取得するには、[Operators]ビューから[Retrieve]をドラッグします。
[Retrieve]オペレータを選択した状態で、[repository entry]の横にあるフォルダアイコンをクリックして[Parameters]ビューで取得するテーブルを定義できます。表示されるRepository ブラウザで接続ノードを展開し、目的のサンプルセットを選択できます。
最後に、[Retrieve]プロセスから結果に出力をワイヤリングし、プロセスを実行してAzure Data Lake Storage を確認します。