File tree 4 files changed +109
-8
lines changed
4 files changed +109
-8
lines changed Original file line number Diff line number Diff line change
1
+ Subproject commit 2fa3e1906dc2892567cbcc1f4041395890064f8c
Original file line number Diff line number Diff line change @@ -133,7 +133,6 @@ Here is an example of how to load data from a CSV file stored on an HTTP server:
133
133
conn.execute("""
134
134
IMPORT INTO your_schema.your_table
135
135
FROM CSV AT 'https://your_https_server/path/to/your/file.csv'
136
- FILE OPTIONS 'DELIMITER=; ENCODING=UTF-8 SKIP_ROWS=1 NULL=NULL'
137
136
""" )
138
137
139
138
For more detailed information on loading data from external sources, please refer to the Exasol documentation:
Original file line number Diff line number Diff line change 1
1
Environments
2
2
============
3
3
4
- Jupyter Notebooks
5
- -----------------
4
+ .. _jupyterlab :
6
5
7
- VSCode
8
- ------
6
+ JupyterLab and JupySQL
7
+ ----------------------
8
+
9
+ Install SQLAlchemy and JupySQL
10
+
11
+ .. code-block :: python
12
+
13
+ pip install sqlalchemy- exasol
14
+ pip install jupysql
15
+
16
+ Connect to Exasol database using SQLAlchemy
17
+
18
+ .. code-block :: python
19
+
20
+ import sqlalchemy
21
+ from sqlalchemy.engine.url import URL
22
+ import getpass
23
+
24
+ db_host = ' my_exasol_host'
25
+ db_port = 8563
26
+ db_username = input (' User Name:' )
27
+ db_password = getpass.getpass(' Password:' )
28
+
29
+ websocket_url = URL .create(
30
+ ' exa+websocket' ,
31
+ host = db_host,
32
+ port = db_port,
33
+ username = db_username,
34
+ password = db_password
35
+ )
36
+
37
+ db_engine = sqlalchemy.create_engine(websocket_url)
38
+
39
+ Enable the Jupyter SQL Extension
40
+
41
+ .. code-block :: python
42
+
43
+ % load_ext sql
44
+ % sql db_engine
45
+
46
+
47
+
48
+ Run queries against Exasol
49
+
50
+ .. code-block :: python
51
+
52
+ %% sql
53
+ SELECT * FROM " FLIGHTS" ." AIRLINE" LIMIT 10
9
54
10
55
Positron
11
- --------
56
+ --------
57
+
58
+ You can either connect to exasol with pyexasol as described in :doc: `getting_started ` or use JupySQL as described in :ref: `jupyterlab `.
59
+
60
+ pyCharm
61
+ -------
62
+
63
+ Please follow the instructions of the official documentation of `pyCharm <https://www.jetbrains.com/help/pycharm/exasol.html >`_.
Original file line number Diff line number Diff line change 1
1
Integrations
2
2
============
3
3
4
+ SQLAlchemy
5
+ ----------
6
+
7
+ Install SQLAlchemy
8
+
9
+ .. code-block :: python
10
+
11
+ pip install sqlalchemy- exasol
12
+
13
+
14
+ Connect to Exasol database using SQLAlchemy
15
+
16
+ .. code-block :: python
17
+
18
+ from sqlalchemy import create_engine
19
+ url = " exa+websocket://A_USER:[email protected] :1234/my_schema?CONNECTIONLCALL=en_US.UTF-8"
20
+ e = create_engine(url)
21
+ r = e.execute(" select 42 from dual" ).fetchall()
22
+
23
+ Please also refer to `sqlalchemy exasol documentation <https://exasol.github.io/sqlalchemy-exasol/master/user_guide.html#user-guide >`_.
24
+
4
25
JupySQL
5
26
-------
6
27
28
+ How to work with JupySQL in JupyterLab is described in :doc: `environments `.
29
+
7
30
Pandas
8
31
------
9
32
33
+ Importing Data into Pandas
34
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
35
+
36
+ You can fetch data from Exasol into a Pandas DataFrame using pyexasol.
37
+
38
+ .. code-block :: python
39
+
40
+ import pandas as pd
41
+
42
+ # Execute a query and fetch data into a Pandas DataFrame, Conn is an existing pyexasol connection.
43
+ df = conn.export_to_pandas(' SELECT * FROM <your_table_name>' )
44
+
45
+ # Display the DataFrame
46
+ print (df)
47
+
48
+ Exporting Data from Pandas to Exasol
49
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
+
51
+ You can also export data from a Pandas DataFrame to an Exasol table.
52
+
53
+ .. code-block :: python
54
+
55
+ # Assume you have a Pandas DataFrame `df` you wish to export
56
+ conn.import_from_pandas(df, ' <your_target_table_name>' )
57
+
10
58
Ibis
11
59
----
12
60
13
- SQLAlchemy
14
- ----------
61
+ Please refer to the `IBIS documentation <https://ibis-project.org/backends/exasol >`_.
62
+
63
+
You can’t perform that action at this time.
0 commit comments