question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integer type mishandled in DDL statements

See original GitHub issue

Athena uses different names for the integer type depending on whether the statement is a DML or DDL one. In the former it uses the regular INTEGER name, but in DDL it uses the name INT.

Currently PyAthena does not distinguish DDL from DML statements, which produces syntax errors when emitting CREATE TABLE statements.

Note that in other places (e.g. pyathena.pandas.utils) this has been correctly handled.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
cansjtcommented, Jan 10, 2022

I am sorry but we did have syntax errors with the INTEGER type at some point.

Maybe it also depends on the storage format from some weird reason, or something else. I am looking into it with a colleague to provide an example. If we find out that we had it wrong and cannot reproduce the issue, we’ll close the issue obviously. Just give us the day, please. Thanks.

0reactions
cansjtcommented, Jan 15, 2022

For memory’s sake: some DDL statements do not handle INTEGER, like:

ALTER TABLE default.some_table ADD COLUMNS (some_data INT);

This is not something that is yet implemented in PyAthena, but we have started implementing some Alembic support for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Types of SQL Statements
The tables in the following sections provide a functional summary of SQL statements and are divided into these categories: Data Definition Language (DDL) ......
Read more >
Data definition language (DDL) statements in ... - Google Cloud
Data definition language (DDL) statements let you create and modify BigQuery resources using Google Standard SQL query syntax. You can use DDL commands...
Read more >
Using DDL Statements - Tutorialspoint
Using DDL Statements to Create and Manage Tables. A schema is the collection of multiple database objects,which are known as schema objects.
Read more >
Database Design - DDL & DML
SQL statements are divided into two major categories: data definition language ... numeric types such as NUMBER or INTEGER, which will usually specify...
Read more >
INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
MySQL supports the SQL standard integer types INTEGER (or INT ) and SMALLINT . As an extension to the standard, MySQL also supports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found