-1

I am having dataframe like below

Rate.head(4)

 KG  Europe_Rate  NAP_Rate
 1     10          8
 2     16          12
 3     19          16
 4     22          18

I want insert this data into AWS table. How can this be done?

Database: Rate
Table   :Customer_Rate

The columns types in AWS athena is double ( KG, Europe_Rate, NAP_Rate).

pankaj
  • 420
  • 1
  • 8
  • 26
  • I am also looking for the answer – Rahul rajan Mar 15 '20 at 04:49
  • I was researching about this. `import awswrangler as wr` doesnt work`. Somebody please post an answer – Ria Alves Mar 15 '20 at 04:52
  • @RiaAlves, You correct, ` awswrangler doesnt work' it gives cannot import name 'infer_compression' error. I am also having an similar issue. looking for an solution – LDF_VARUM_ELLAM_SHERIAAVUM Mar 15 '20 at 04:55
  • Can you confirm where you are running import awswrangler as wr statement in? Which environment ? – Prabhakar Reddy Mar 16 '20 at 05:10
  • @bdcloud, I am running `import awswrangler as wr` in a sagemaker jupyter notebook and my anacond version is `3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0]` – Ria Alves Mar 16 '20 at 06:31
  • Can you try installing it in your code using easy install and see if its working fine ? refer to https://stackoverflow.com/a/54852126/4326922 – Prabhakar Reddy Mar 16 '20 at 06:33
  • @bdcloud, I am also having same issue while importing awswrangler. Can you explain little bit more . I referred the question you have shared but not able connect. If you post as answer will be good – LDF_VARUM_ELLAM_SHERIAAVUM Mar 16 '20 at 06:49
  • Try installing it with below code :. import os import site from setuptools.command import easy_install install_path = os.environ['GLUE_INSTALLATION'] easy_install.main( ["--install-dir", install_path, ""] ) reload(site) import – Prabhakar Reddy Mar 16 '20 at 06:52

1 Answers1

1

AWS Athena queries data on S3. It supports many different types of data such as CSV, JSON, Parquet, etc. If you write your data frame as a CSV to an S3 bucket and then create a table in Athena you will be able to query the data with Athena. You can find an example of how to create a table that reads CSV data here: https://docs.aws.amazon.com/athena/latest/ug/lazy-simple-serde.html

Theo
  • 131,503
  • 21
  • 160
  • 205