Git Product home page Git Product logo

Comments (5)

laughingman7743 avatar laughingman7743 commented on September 25, 2024

Please describe the issue in detail, and I need the SQLAlchemy version as well.
Code or stack trace that reproduces the issue is even better.

from pyathena.

logorrheic avatar logorrheic commented on September 25, 2024

Certainly.

Code:

from sqlalchemy import Column, MetaData
from sqlalchemy.types import BigInteger, Integer, SmallInteger
from sqlalchemy.sql.schema import Table
from sqlalchemy import create_mock_engine
from sqlalchemy.schema import CreateTable

table = Table(
    "t1",
    MetaData(),
    Column("id", Integer, primary_key=True),
    Column("small", SmallInteger),
    Column("medium", Integer),
    Column("large", BigInteger),
    awsathena_location="s3://bucket",
)


def executor(_1, _2, _3):
    pass


engine = create_mock_engine("awsathena+rest:///", executor)
ddl = CreateTable(table).compile(bind=engine)

print(ddl)

Which produces:

CREATE EXTERNAL TABLE t1 (
        id INT,
        small INT,
        medium INT,
        large INT
)
LOCATION 's3://bucket/'

But should produce:

CREATE EXTERNAL TABLE t1 (
        id INT,
        small SMALLINT,
        medium INT,
        large BIGINT
)
LOCATION 's3://bucket/'

Origin of the problem seems to be here.

SQLAlchemy 2.0.27.

from pyathena.

laughingman7743 avatar laughingman7743 commented on September 25, 2024

All are INT types. I will check this weekend.

from pyathena.

logorrheic avatar logorrheic commented on September 25, 2024

Sorry, my terminology may be unhelpful, I was meaning smallint and bigint are variants of integer.

from pyathena.

laughingman7743 avatar laughingman7743 commented on September 25, 2024

No problem. I think it is an issue to handle everything with INT type.

from pyathena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.