h2o-py/h2o/h2o.py
def import_sql_select(connection_url, select_query, username, password, optimize=True, 
                      use_temp_table=None, temp_table_name=None, fetch_mode=None):
    """
    Import the SQL table that is the result of the specified SQL query to H2OFrame in memory.

    Creates a temporary SQL table from the specified sql_query.
    Runs multiple SELECT SQL queries on the temporary table concurrently for parallel ingestion, then drops the table.
    Be sure to start the h2o.jar in the terminal with your downloaded JDBC driver in the classpath::

      java -cp <path_to_h2o_jar>:<path_to_jdbc_driver_jar> water.H2OApp

    Also see h2o.import_sql_table. Currently supported SQL databases are MySQL, PostgreSQL, MariaDB, Hive, Oracle 
    and Microsoft SQL Server.

    :param connection_url: URL of the SQL database connection as specified by the Java Database Connectivity (JDBC)
        Driver. For example, "jdbc:mysql://localhost:3306/menagerie?&useSSL=false"
    :param select_query: SQL query starting with `SELECT` that returns rows from one or more database tables.
    :param username: username for SQL server
    :param password: password for SQL server
    :param optimize: DEPRECATED. Ignored - use fetch_mode instead. Optimize import of SQL table for faster imports.
    :param use_temp_table: whether a temporary table should be created from select_query
    :param temp_table_name: name of temporary table to be created from select_query
    :param fetch_mode: Set to DISTRIBUTED to enable distributed import. Set to SINGLE to force a sequential read by a single node
        from the database.

    :returns: an :class:`H2OFrame` containing data of the specified SQL query.

    :examples:
        >>> conn_url = "jdbc:mysql://172.16.2.178:3306/ingestSQL?&useSSL=false"
        >>> select_query = "SELECT bikeid from citibike20k"
        >>> username = "root"
        >>> password = "abc123"
        >>> my_citibike_data = h2o.import_sql_select(conn_url, select_query,
        ...                                          username, password, fetch_mode)
    """
    assert_is_type(connection_url, str)
    assert_is_type(select_query, str)
    assert_is_type(username, str)
    assert_is_type(password, str)
    assert_is_type(optimize, bool)
    assert_is_type(use_temp_table, bool, None)
    assert_is_type(temp_table_name, str, None)
    assert_is_type(fetch_mode, str, None)
    p = {"connection_url": connection_url, "select_query": select_query, "username": username, "password": password,
         "use_temp_table": use_temp_table, "temp_table_name": temp_table_name, "fetch_mode": fetch_mode}
    j = H2OJob(api("POST /99/ImportSQLTable", data=p), "Import SQL Table").poll()
    return get_frame(j.dest_key)
def import_sql_select(connection_url, select_query, username, password, optimize=True, 
                      use_temp_table=None, temp_table_name=None, fetch_mode=None):
    assert_is_type(connection_url, str)
    assert_is_type(select_query, str)
    assert_is_type(username, str)
    assert_is_type(password, str)
    assert_is_type(optimize, bool)
    assert_is_type(use_temp_table, bool, None)
    assert_is_type(temp_table_name, str, None)
    assert_is_type(fetch_mode, str, None)
    p = {"connection_url": connection_url, "select_query": select_query, "username": username, "password": password,
         "use_temp_table": use_temp_table, "temp_table_name": temp_table_name, "fetch_mode": fetch_mode}
    j = H2OJob(api("POST /99/ImportSQLTable", data=p), "Import SQL Table").poll()
    return get_frame(j.dest_key)
def import_sql_select ( connection_url , select_query , username , password , optimize = True , use_temp_table = None , temp_table_name = None , fetch_mode = None ) : assert_is_type ( connection_url , str ) assert_is_type ( select_query , str ) assert_is_type ( username , str ) assert_is_type ( password , str ) assert_is_type ( optimize , bool ) assert_is_type ( use_temp_table , bool , None ) assert_is_type ( temp_table_name , str , None ) assert_is_type ( fetch_mode , str , None ) p = { "connection_url" : connection_url , "select_query" : select_query , "username" : username , "password" : password , "use_temp_table" : use_temp_table , "temp_table_name" : temp_table_name , "fetch_mode" : fetch_mode } j = H2OJob ( api ( "POST /99/ImportSQLTable" , data = p ) , "Import SQL Table" ) . poll ( ) return get_frame ( j . dest_key )
Import the SQL table that is the result of the specified SQL query to H2OFrame in memory.

    Creates a temporary SQL table from the specified sql_query.
    Runs multiple SELECT SQL queries on the temporary table concurrently for parallel ingestion, then drops the table.
    Be sure to start the h2o.jar in the terminal with your downloaded JDBC driver in the classpath::

      java -cp <path_to_h2o_jar>:<path_to_jdbc_driver_jar> water.H2OApp

    Also see h2o.import_sql_table. Currently supported SQL databases are MySQL, PostgreSQL, MariaDB, Hive, Oracle 
    and Microsoft SQL Server.

    :param connection_url: URL of the SQL database connection as specified by the Java Database Connectivity (JDBC)
        Driver. For example, "jdbc:mysql://localhost:3306/menagerie?&useSSL=false"
    :param select_query: SQL query starting with `SELECT` that returns rows from one or more database tables.
    :param username: username for SQL server
    :param password: password for SQL server
    :param optimize: DEPRECATED. Ignored - use fetch_mode instead. Optimize import of SQL table for faster imports.
    :param use_temp_table: whether a temporary table should be created from select_query
    :param temp_table_name: name of temporary table to be created from select_query
    :param fetch_mode: Set to DISTRIBUTED to enable distributed import. Set to SINGLE to force a sequential read by a single node
        from the database.

    :returns: an :class:`H2OFrame` containing data of the specified SQL query.

    :examples:
        >>> conn_url = "jdbc:mysql://172.16.2.178:3306/ingestSQL?&useSSL=false"
        >>> select_query = "SELECT bikeid from citibike20k"
        >>> username = "root"
        >>> password = "abc123"
        >>> my_citibike_data = h2o.import_sql_select(conn_url, select_query,
        ...                                          username, password, fetch_mode)
Import the SQL table that is the result of the specified SQL query to H2OFrame in memory .