CSV データソースへの接続
CSV への接続
以下は、本製品 のデフォルトのデータモデリング設定を使用したCSV ファイルまたはストリームへの接続文字列の例です。
サービスプロバイダ | URI 形式 | 接続例 |
Local | localPath
file:///localPath | URI=C:/folder1; |
HTTP またはHTTPS | http://remoteStream
https://remoteStream | URI=http://www.host1.com/streamname1; |
Amazon S3 | s3://bucket1/folder1 | URI=s3://bucket1/folder1; AWSSecretKey=secret1; AWSRegion=OHIO; |
Azure Blob Storage | azureblob://mycontainer/myblob/ | URI=azureblob://mycontainer/myblob/; AzureAccount=myAccount; AzureAccessKey=myKey; |
Google Drive | gdrive://remotePath
gdrive://SharedWithMe/remotePath | URI=gdrive://folder1; AuthScheme=OAuth;
URI=gdrive://SharedWithMe/folder1; AuthScheme=OAuth; |
OneDrive | onedrive://remotePath
onedrive://SharedWithMe/remotePath | URI=onedrive://folder1; AuthScheme=OAuth;
URI=onedrive://SharedWithMe/folder1; AuthScheme=OAuth; |
Box | box://remotePath | URI=box://folder1; AuthScheme=OAuth; |
Dropbox | dropbox://remotePath | URI=dropbox://folder1; AuthScheme=OAuth; OAuthClientId=oauthclientid1; OAuthClientSecret=oauthcliensecret1; CallbackUrl=http://localhost:12345; |
Sharepoint SOAP | sp://remotePath | URI=sp://Documents/folder1; User=user1; Password=password1; SharepointUrl=https://subdomain.sharepoint.com; |
Sharepoint REST | sprest://remotePath | URI=sprest://Documents/folder1; AuthScheme=OAuth; SharepointUrl=https://subdomain.sharepoint.com; |
FTP またはFTPS | ftp://server:port/remotePath
ftps://server:port/remotepath | URI=ftps://localhost:990/folder1; User=user1; Password=password1; |
SFTP | sftp://server:port/remotePath | URI=sftp://127.0.0.1:22/folder1 User=user1; Password=password1;
URI=sftp://127.0.0.1:22/folder1 SSHAuthmode=PublicKey; SSHClientCert=myPrivateKey |
Azure Data Lake Store Gen1 | adl://remotePath
adl://Account.azuredatalakestore.net@remotePath | URI=adl://folder1; AuthScheme=OAuth; AzureAccount=myAccount; AzureTenant=tenant;
URI=adl://myAccount.azuredatalakestore.net@folder1; AuthScheme=OAuth; AzureTenant=tenant; |
AzureDataLakeStoreGen2 | abfs://myfilesystem/remotePath
abfss://myfilesystem@accountName.dfs.core.windows.net/remotepath
| URI=abfs://myfilesystem/folder1; AzureAccount=myAccount; AzureAccessKey=myKey;
URI=abfss://myfilesystem@myAccount.dfs.core.windows.net/folder1; AzureAccessKey=myKey; |
AzureDataLakeStoreGen2 with SSL | abfss://myfilesystem/remotePath
abfs://myfilesystem@accountName.dfs.core.windows.net/remotepath
| URI=abfss://myfilesystem/folder1; AzureAccount=myAccount; AzureAccessKey=myKey;
URI=abfss://myfilesystem@myAccount.dfs.core.windows.net/folder1; AzureAccessKey=myKey; |
Wasabi | wasabi://bucket/remotePath | URI=wasabi://bucket/folder1; AccessKey=token1; SecretKey=secret1; Region='us-west-1'; |
Google Cloud Storage | gs://bucket/remotePath | URI=gs://bucket/folder1; AuthScheme=OAuth; ProjectId=test; |
Oracle Cloud Storage | os://bucket/remotePath | URI=os://bucket/folder1; AccessKey='myKey'; SecretKey='mySecretKey'; OracleNameSpace='myNameSpace' Region='us-west-1'; |
動的なスキーマ検出
次のプロパティを設定して、本製品 が接続時に自動的にCSV をテーブルとしてモデル化する方法を制御します。
- HDR:指定したファイルの一行目からカラム名を取得するように設定します(デフォルト)。そうでない場合は、カラム名はカラム番号になります。
- FMT:テキストファイルのパースに使用する形式に設定します。CsvDelimited(デフォルト)またはTabDelimited。
- IncludeFiles:テーブルとしてモデル化されたファイル一式に含めるファイル拡張子のカンマ区切りリストに設定します。(デフォルトでは.txt、.tab、および.csv ファイルがモデル化されます。)
- RowScanDepth:指定した深さまで行をスキャンして、データ型を自動的に決定するように設定します。
ローカルCSV で作業する場合は、Microsoft Jet ドライバーと互換性のあるSchema.ini ファイルを使用してカラムとデータ型を定義することもできます。Schema.ini の使用 を参照してください。
スキーマのカスタマイズ
カラムのデータ型およびスキーマのその他の側面をカスタマイズするには、スキーマを静的なコンフィギュレーションファイルに保存できます。コンフィギュレーションファイルはシンプルな形式となっており、簡単に拡張できます。本製品 スキーマの拡張について詳しくは、スキーマファイルの生成 を参照してください。
サブフォルダへのアクセス
次のプロパティを設定して、サブフォルダをビューとしてモデル化します。
- IncludeSubdirectories:ネストされたフォルダからファイルやSchema.ini を読み出すように設定します。名前衝突が起こった場合は、テーブル名の前にアンダースコアで区切られたフォルダ名が付けられます。デフォルト値はfalse です。
- DirectoryRetrievalDepth:IncludeSubdirectories が設定されている場合に、再帰的にスキャンするサブフォルダの数を設定します。デフォルトでは、本製品 はすべてのサブフォルダをスキャンします。
IncludeSubdirectories が設定されている場合、自動的に検出されるテーブル名は以下の規則に従います。
ファイルパス | Root\subfolder1\tableA | Root\subfolder1\subfolder2\tableA |
テーブル名 | subfolder1_tableA | subfolder1_subfolder2_tableA |