Interface DatabendConnectionExtension

  • All Known Implementing Classes:
    DatabendConnection

    public interface DatabendConnectionExtension
    The SnowflakeConnection interface contains Snowflake-specific methods. providing specialized methods for interacting with Databend stages and loading data efficiently.

    This interface extends standard JDBC connection capabilities to support streaming operations for uploading/downloading files to/from internal stages, as well as direct streaming data loading into target tables. Ideal for handling large files or continuous data streams in Databend.

    • Method Detail

      • uploadStream

        void uploadStream​(InputStream inputStream,
                          String stageName,
                          String destPrefix,
                          String destFileName,
                          long fileSize,
                          boolean compressData)
                   throws SQLException
        Upload inputStream 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 file
        destPrefix - the prefix of the file name in the stage
        inputStream - the input stream of the file
        destFileName - the destination file name in the stage
        fileSize - the file size in the stage
        compressData - whether to compress the data
        Throws:
        SQLException - failed to upload input stream
      • downloadStream

        InputStream downloadStream​(String stageName,
                                   String sourceFileName)
                            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 file
        sourceFileName - the file name in the stage
        Returns:
        the input stream of the file
        Throws:
        SQLException - failed to download input stream