|
256 | 256 | "id": "0dc80445-e5c0-43c1-ae34-f16326d6fb94", |
257 | 257 | "metadata": {}, |
258 | 258 | "source": [ |
259 | | - "**Please note**: \n", |
260 | | - "* Parquet import requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
261 | | - "* Hence, the import is currently commented out.\n", |
| 259 | + "**Please note**: Parquet import via SQL statement `IMPORT` requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
262 | 260 | "\n", |
263 | 261 | "Now we can import the Parquet file from S3 into the database:" |
264 | 262 | ] |
|
271 | 269 | "outputs": [], |
272 | 270 | "source": [ |
273 | 271 | "%%sql \n", |
274 | | - "SELECT 1 -- avoid error from empty cell \n", |
275 | 272 | "\n", |
276 | | - "-- IMPORT INTO US_FLIGHTS FROM PARQUET AT AI_LAB_FIRST_STEPS_S3 \n", |
277 | | - "-- FILE 'first_steps/US_FLIGHTS_FEB_2024.parquet'" |
| 273 | + "IMPORT INTO US_FLIGHTS FROM PARQUET AT AI_LAB_FIRST_STEPS_S3 \n", |
| 274 | + " FILE 'first_steps/US_FLIGHTS_FEB_2024.parquet'" |
278 | 275 | ] |
279 | 276 | }, |
280 | 277 | { |
|
305 | 302 | "\n", |
306 | 303 | "[PyExasol](https://exasol.github.io/pyexasol/master/index.html) is the basic Python connector for interacting with Exasol databases.\n", |
307 | 304 | "\n", |
308 | | - "Please note\n", |
309 | | - "* Using PyExasol's import or export functions with Exasol database versions `2025.*` and higher requires Pyexasol version ≥ `1.2`.\n", |
310 | | - "* AI Lab currently is shipped with pyexasol version `0.27.0`.\n", |
311 | | - "* Hence, the Pyexasol examples can only be executed with Exasol database versions < `2025`.\n", |
312 | | - "\n", |
313 | 305 | "### 3.1 Importing a CSV File from the Local Filesystem\n", |
314 | 306 | "\n", |
315 | 307 | "This section demonstrates how to import a CSV file from the local file system into the database using Pyexasol.\n", |
|
456 | 448 | "metadata": {}, |
457 | 449 | "source": [ |
458 | 450 | "**Please note**: \n", |
459 | | - "* Parquet import requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
460 | | - "* Hence, the import is currently commented out.\n", |
| 451 | + "* Parquet import via SQL statement `IMPORT` requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
| 452 | + "* This restriction does not apply when using PyExasol's native function [import_from_parquet()](https://exasol.github.io/pyexasol/master/user_guide/exploring_features/import_and_export/index.html#id8).\n", |
461 | 453 | "\n", |
462 | 454 | "Now we can import the Parquet file from S3 into the database:" |
463 | 455 | ] |
|
471 | 463 | "source": [ |
472 | 464 | "from exasol.nb_connector.connections import open_pyexasol_connection\n", |
473 | 465 | "\n", |
474 | | - "query = \"IMPORT INTO {table!q} FROM PARQUET AT {connection} FILE {file!s}\"\n", |
| 466 | + "query = \"IMPORT INTO {table!q} FROM PARQUET AT {connection!r} FILE {file!s}\"\n", |
475 | 467 | "\n", |
476 | 468 | "params = {\n", |
477 | 469 | " \"table\": (ai_lab_config.db_schema, \"US_FLIGHTS\"),\n", |
478 | 470 | " \"connection\": \"AI_LAB_FIRST_STEPS_S3\",\n", |
479 | 471 | " \"file\": \"first_steps/US_FLIGHTS_FEB_2024.parquet\",\n", |
480 | 472 | "}\n", |
481 | 473 | "\n", |
482 | | - "#with open_pyexasol_connection(ai_lab_config, compression=True) as conn:\n", |
483 | | - "# result = conn.execute(query, params)\n", |
484 | | - "#print(f\"Imported {result.rowcount()} rows.\")" |
| 474 | + "with open_pyexasol_connection(ai_lab_config, compression=True) as conn:\n", |
| 475 | + " result = conn.execute(query, params)\n", |
| 476 | + "print(f\"Imported {result.rowcount()} rows.\")" |
485 | 477 | ] |
486 | 478 | }, |
487 | 479 | { |
|
578 | 570 | "id": "d11dcb6d-d3e5-4e1e-8d61-ba59897c56e9", |
579 | 571 | "metadata": {}, |
580 | 572 | "source": [ |
581 | | - "**Please note**: \n", |
582 | | - "* Parquet import requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
583 | | - "* Hence, the import is currently commented out.\n", |
| 573 | + "**Please note**: Parquet import via SQL statement `IMPORT` requires using **<span style=\"color: #40a\">Exasol version 2025.\\* or higher</span>**, see [docs.exasol.com](https://docs.exasol.com/db/latest/loading_data/load_data_parquet.htm).\n", |
584 | 574 | "\n", |
585 | 575 | "Now we can import the Parquet file from S3 into the database:" |
586 | 576 | ] |
|
604 | 594 | " )\n", |
605 | 595 | ")\n", |
606 | 596 | "\n", |
607 | | - "# with engine.connect() as conn:\n", |
608 | | - "# result = conn.execute(t)\n", |
609 | | - "# print(f\"Imported {result.rowcount} rows.\")" |
| 597 | + "with engine.connect() as conn:\n", |
| 598 | + " result = conn.execute(t)\n", |
| 599 | + "print(f\"Imported {result.rowcount} rows.\")" |
610 | 600 | ] |
611 | 601 | }, |
612 | 602 | { |
|
0 commit comments