| hanaml.ConnectionContext {hana.ml.r} | R Documentation |
Represents a connection to a HANA system. ConnectionContext includes methods for creating DataFrames from data on HANA. DataFrames are tied to a ConnectionContext, and are unusable once their ConnectionContext is closed.
hanaml.ConnectionContext(dsn,
username,
password,
odbc = TRUE,
jdbcDriver = NULL,
...)
dsn |
|
username |
|
password |
|
odbc |
|
jdbcDriver |
|
R6Class object.
Object of R6Class with methods for ConnectionContext
close()Closes the existing connection.
Usage:
conn$close()
sql()Returns a DataFrame representing a query.
Usage:
df <- conn$sql('SELECT T.A, T2.B FROM T, T2 WHERE T.C=T2.C')
Arguments:
sql: Sql Query
Returns:
DataFrame
Dataframe for the query.
GetCurrentSchema()Returns the name of current working schema in the database.
Usage: dataframe$GetCurrentSchema()
Returns:
character
Current schema name.
table()Returns a DataFrame representing a table.
Usage:
df1 <- conn$table('MY_TABLE')
df2 <- conn$table('MY_OTHER_TABLE', schema='MY_SCHEMA')
Arguments:
table: Table Name
schema: Schema name. If not provided or set to None,
defaults to the ConnectionContext's current schema.
Returns:
DataFrame
Dataframe selecting data from that table.