/*
 * Copyright (c) 2012-2019 Snowflake Computing Inc. All rights reserved.
 */

package net.snowflake.client.jdbc;

import java.io.InputStream;
import java.sql.SQLException;

/**
 * This interface defines Snowflake specific APIs for Connection
 */
public interface SnowflakeConnection
{
  /**
   * Method to compress data from a stream and upload it at a stage location.
   * The data will be uploaded as one file. No splitting is done in this method.
   * <p>
   * caller is responsible for releasing the inputStream after the method is
   * called.
   *
   * @param stageName    stage name: e.g. ~ or table name or stage name
   * @param destPrefix   path prefix under which the data should be uploaded on the stage
   * @param inputStream  input stream from which the data will be uploaded
   * @param destFileName destination file name to use
   * @param compressData compress data or not before uploading stream
   * @throws SQLException failed to compress and put data from a stream at stage
   */
  void uploadStream(String stageName,
                    String destPrefix,
                    InputStream inputStream,
                    String destFileName,
                    boolean compressData) throws SQLException;
}

@@ -1223,11 +1223,489 @@
 ception;
+%0A%0A  /**%0A   * Download file from the given stage and return an input stream%0A   *%0A   * @param stageName      stage name%0A   * @param sourceFileName file path in stage%0A   * @param decompress     true if file compressed%0A   * @return an input stream%0A   * @throws SnowflakeSQLException if any SQL error occurs.%0A   */%0A  InputStream downloadStream(String stageName,%0A                             String sourceFileName,%0A                             boolean decompress) throws SQLException;
 %0A%7D%0A

add SnowflakeConnection interface. (part 2: downloadstream)