Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Illegal reflective access #82

Closed
otmezger opened this issue Jun 13, 2019 · 5 comments
Closed

Illegal reflective access #82

otmezger opened this issue Jun 13, 2019 · 5 comments

Comments

@otmezger
Copy link
Contributor

Hi, I'm getting this warning:

WARNING: Illegal reflective access by com.simba.athena.shaded.fasterxml.jackson.databind.util.ClassUtil (file:/Users/olmo/anaconda3/envs/bsk/lib/python3.6/site-packages/pyathenajdbc/AthenaJDBC42_2.0.7.jar) to field java.lang.Throwable.cause
WARNING: Please consider reporting this to the maintainers of com.simba.athena.shaded.fasterxml.jackson.databind.util.ClassUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I see this when I run the following code

def get_conn_athena():
   s3_staging_dir = 's3://vblabla/parquet/'
   schema_name = 'blablabla'
    conn_athena = connect(
        s3_staging_dir=s3_staging_dir,
        schema_name=schema_name,
        region_name='eu-central-1',
        S3OutputLocation=s3_staging_dir + "query_results/" 
    )
    return conn_athena
    conn_athena = get_conn_athena()
    cur_athena = conn_athena.cursor()

    sql = """
                SELECT max(seen_time_rounded) as seen_time_rounded
                                FROM {source_table_name}
                                WHERE api_id = %(api_id)s 
                                and seen_time_rounded < %(now_formatted_as_seen_time_rounded)s;
                """.format(source_table_name='mytable')
    cur = cur_athena
    params = dict(
        api_id=api_id,
        now_formatted_as_seen_time_rounded=datetime.now().strftime('%Y-%m-%d-%H-%M')
    )

    cur.execute(sql, params)

any idea why this is happening? happy to help debugging if necessary.

@otmezger
Copy link
Contributor Author

I found this: FasterXML/jackson-databind#2312

@laughingman7743
Copy link
Owner

I do not know the implementation of the JDBC driver because it is not open source.
It will improve if you report it to the AWS Forum or AWS Support.

@gpfreitas
Copy link

@otmezger had a similar error message, but it was being caused by a syntax error in the query (!).

In my case, it was an extra/invalid comma before the final SELEC with a CTE:

-- caused errors
with aux_table as (
 ...
),
select * from aux_table limit 10
-- no problems
with aux_table as (
  ...
)
select * from aux_table limit 10

I haven't checked your query, but you may want to check that.

@gpfreitas
Copy link

@otmezger nevermind, the fixed syntax makes the query run fine, but I still get the "reflexive access" warning. I didn't notice because I wasn't paying attention to the logs.

@otmezger
Copy link
Contributor Author

@gpfreitas we never solved this. We just switched to https://github.com/laughingman7743/PyAthena. It's much much better.

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

No branches or pull requests

3 participants