Coder Social home page Coder Social logo

Comments (4)

jaidisido avatar jaidisido commented on May 26, 2024 1

In the athena.to_iceberg call, the Iceberg table is created with an Athena DDL query not a Glue call. This rePost article points to the same solution.

from aws-sdk-pandas.

plbremer avatar plbremer commented on May 26, 2024

In the athena.to_iceberg call, the Iceberg table is created with an Athena DDL query not a Glue call. This rePost article points to the same solution.

Does the following makes sense then:

  • One cannot use awswrangler.catalog.* to create iceberg tables for athena
  • Instead, if one wants to use awswrangler to create iceberg tables without downloading the contents into a local dataframe, one can only hope to use awswrangler.athena.read_sql_query with a query that might have been templated based on properly parsed parquet metadata from something like awswrangler.s3.read_parquet_metadata

I assume that the syntactically proper CREATE TABLE query would also deposity the appropriate iceberg metadata in the s3 containing the parquet file...?

from aws-sdk-pandas.

jaidisido avatar jaidisido commented on May 26, 2024

Below is a simplified version of the code I linked in my previous comment using the start_query_execution API:

   sql = (
        f"CREATE TABLE IF NOT EXISTS `{table}` ({cols_str}) "
        f"LOCATION '{path}' "
        f"TBLPROPERTIES ('table_type'='ICEBERG', 'format'='parquet')"
    )

    wr.athena.start_query_execution(sql=sql, database=database, wait=True)

It simply follows what is described in the Iceberg Athena docs. You might have to play a bit with the parameters to the API but that is the gist of it

from aws-sdk-pandas.

plbremer avatar plbremer commented on May 26, 2024

Below is a simplified version of the code I linked in my previous comment using the start_query_execution API:

   sql = (
        f"CREATE TABLE IF NOT EXISTS `{table}` ({cols_str}) "
        f"LOCATION '{path}' "
        f"TBLPROPERTIES ('table_type'='ICEBERG', 'format'='parquet')"
    )

    wr.athena.start_query_execution(sql=sql, database=database, wait=True)

It simply follows what is described in the Iceberg Athena docs. You might have to play a bit with the parameters to the API but that is the gist of it

Ok great, I agree with this, thanks

from aws-sdk-pandas.

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.