Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Athena Database Connector #352

Merged
merged 101 commits into from
Apr 10, 2018
Merged

Athena Database Connector #352

merged 101 commits into from
Apr 10, 2018

Conversation

shannonlal
Copy link
Contributor

This is the first pull request for the Athena Database Connector #261. A couple of notes:

  1. I broke the Athena database connector into two files. The first is the Athena Connector similar to the other Falcon DB Connectors which defines the standard interfaces (connect, query, tables, schema, etc). The second file just handles the connection to Athena using the AWS SDK. I broke this into a separate file as it made unit testing easier and also if at some point a standard NodeJS library for Athena becomes available it would be easier to replaces this.

  2. I was not able to create an integration test for this connector as I don't have access to a Plot.ly instance of Athena.

  3. This is my first major PR on this project so I welcome any and all comments or suggestions.

@shannonlal
Copy link
Contributor Author

@n-riesco Just as an FYI I am based out of Montreal. So if the Plot.ly folks want I can swing by their office in the mile end and walk them through creating the table in Athena if this will help move this along. Just a thought.

@n-riesco
Copy link
Contributor

@shannonlal I'm forwarding your message. Again, sorry about the delay.

@jackparmer
Copy link
Contributor

Hey @shannonlal - thanks for the offer. I just invited the hotmail address in your bio to Plotly's slack if you want to coordinate there. You're welcome by the office anytime!

@n-riesco n-riesco mentioned this pull request Mar 13, 2018
10 tasks
@shannonlal
Copy link
Contributor Author

@n-riesco I just pulled in the latest changes from the master branch into this PR. I am looking at the comments we discussed about this morning

@n-riesco
Copy link
Contributor

@shannonlal OK, I'll be online here and on slack. Please, ping me, if anything needs clarification.

@shannonlal
Copy link
Contributor Author

shannonlal commented Mar 30, 2018

@n-riesco . I just wanted to summarize your PR comments into one location. Can you let me know if the following changes to this PR make sense:

  1. get rid of createAthenaClient: https://github.com/shannonlal/falcon-sql-client/blob/90842418006c35bd9b28f5c6ea2d84637a9887bf/backend/persistent/datastores/drivers/athena.js#L15-L30 - Done

  2. create AWS.Athena inside connect - Done

  3. things would be easier if the connection object and the config used in new AWS.Athena(config) were the same - Done

  4. get rid of these checks https://github.com/shannonlal/falcon-sql-client/blob/90842418006c35bd9b28f5c6ea2d84637a9887bf/backend/persistent/datastores/athena.js#L29-L51 (AWS.Athena(config) already checks for those missing properties).

  5. For the datastore.athena.test.js add unit tests for the following methods:connect, tables, schemas, and query

Does this make sense?

@n-riesco
Copy link
Contributor

@shannonlal 👍

shannonlal and others added 9 commits March 30, 2018 14:44
* All tests share the Athena connection.

* Added connect() test and ensured it runs first, so that
  connection.athenaClient is defined for the remaining tests.

* Defined helper function mockAthenaResponses(query, columnNames, rows).

* Fixed tables() test (tables() shouldn't return the column name
  `table_names`).
* Fixed tables() so that it doesn't return the column name table_names.

* Avoided the creation of unnecessary promises.

* Used slice() and map() to generate the response rows.
@n-riesco
Copy link
Contributor

n-riesco commented Apr 9, 2018

💃

@shannonlal shannonlal merged commit a2fe8bd into plotly:master Apr 10, 2018
@imsrgadich
Copy link

I'm getting the following error.

HIVE_METASTORE_ERROR: com.facebook.presto.spi.PrestoException: varchar type is specified without length: varchar (Service: null; Status Code: 0; Error Code: null; Request ID: null)

What is the solution for this?

@shannonlal
Copy link
Contributor Author

shannonlal commented Feb 2, 2020 via email

@imsrgadich
Copy link

imsrgadich commented Feb 2, 2020 via email

@theclash12072002
Copy link

Hi, i have the same problem: HIVE_METASTORE_ERROR: com.facebook.presto.spi.PrestoException: varchar type is specified without length: varchar (Service: null; Status Code: 0; Error Code: null; Request ID: null)

from glue i created a crawler for a table in Aurora MySQL with a column varchar(50), into the crawler has been set like string and an error appear running an athena query:
HIVE_METASTORE_ERROR: unable to create input format

so i changed the data type varchar into the crawler but i can't specify the length.

There are any news?

@theclash12072002
Copy link

I tried with a simple Aurora table within a single field of type int, the error is the previous first:
HIVE_UNKNOWN_ERROR: Unable to create input format

running the crawler it found the new table and from Athena it appear running show tables.
Maybe the problem can be in the empty "Edit table details"??

Thanks

@theclash12072002
Copy link

link to resolve the error "unable to create input format" in Athena: https://aws.amazon.com/premiumsupport/knowledge-center/athena-unable-to-create-input-format/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants