Package com.databend.jdbc
Interface FileTransferAPI
- All Known Implementing Classes:
DatabendConnection
public interface FileTransferAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoidcopyIntoTable(String database, String tableName, DatabendStage stage, DatabendCopyParams params) Copy into the target table from files on the internal stage Documentation: https://databend.rs/doc/sql-commands/dml/dml-copy-into-tabledownloadStream(String stageName, String sourceFileName, boolean decompress) Download a file from the databend internal stage, the data would be downloaded as one file with no split.voiduploadStream(String stageName, String destPrefix, InputStream inputStream, String destFileName, boolean compressData) Upload a file to the databend internal stage, the data would be uploaded as one file with no split.
-
Method Details
-
uploadStream
void uploadStream(String stageName, String destPrefix, InputStream inputStream, String destFileName, boolean compressData) throws SQLException Upload a file to the databend internal stage, the data would be uploaded as one file with no split. Caller should close the input stream after the upload is done.- Parameters:
stageName- the stage which receive uploaded filedestPrefix- the prefix of the file name in the stageinputStream- the input stream of the filedestFileName- the destination file name in the stagecompressData- whether to compress the data- Throws:
SQLException- failed to upload input stream
-
downloadStream
InputStream downloadStream(String stageName, String sourceFileName, boolean decompress) throws SQLException Download a file from the databend internal stage, the data would be downloaded as one file with no split.- Parameters:
stageName- the stage which contains the filesourceFileName- the file name in the stagedecompress- whether to decompress the data- Returns:
- the input stream of the file
- Throws:
SQLException
-
copyIntoTable
void copyIntoTable(String database, String tableName, DatabendStage stage, DatabendCopyParams params) throws SQLException Copy into the target table from files on the internal stage Documentation: https://databend.rs/doc/sql-commands/dml/dml-copy-into-table- Parameters:
database- the target table's databasetableName- the target table namestage- the stage which contains the filesparams- copy options and file options- Throws:
SQLException
-