Giter Site home page Giter Site logo

Comments (6)

abridgett avatar abridgett commented on May 13, 2024 1

super - that works well here - saves a load of time figuring out what's wrong :-)

from pyathenajdbc.

laughingman7743 avatar laughingman7743 commented on May 13, 2024

I think that the difference in error message may be due to the difference in version of JDBC driver.
The correspondence of JDBC driver version is as follows.

version JDBC driver version
v1.1.1 AthenaJDBC41-1.0.1
v1.3.1 AthenaJDBC41-1.1.0

Please let me know the table definition and the query where the error occurred.

Thanks,

from pyathenajdbc.

abridgett avatar abridgett commented on May 13, 2024

Gosh - that was fast! It looks like not the JDBC driver change:

I'm running this SQL:

select count(*) from speed_augmented_v2 where dt='2018-01-01' and client_code in %(app_list)s

Our wrapper didn't support lists (now fixed) so app_list was a string rather than list object which caused the SQL error.

On PyAthenaJDBC v1.1.1 (AthenaJDBC v1.0.1):

2018-02-15 14:21:53,640 ERROR    Failed to execute query.
Traceback (most recent call last):
  File "/Users/adrian/projects/os/data-athena/venv/lib/python3.6/site-packages/pyathenajdbc/cursor.py", line 117, in execute
    result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
2018-02-15 14:21:53,646 ERROR    line 1:79: mismatched input 'in' expecting {<EOF>, 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'OR', 'AND', 'UNION', 'EXCEPT', 'INTERSECT'} (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: 91ff6d70-125b-11e8-a10f-e52a7edfa5db)

On PyAthenaJDBC v1.3.1 (AthenaJDBC v1.1.0):

2018-02-15 14:22:52,618 ERROR    Failed to execute query.
Traceback (most recent call last):
  File "/Users/adrian/projects/os/data-athena/venv/lib/python3.6/site-packages/pyathenajdbc/cursor.py", line 172, in execute
    result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
2018-02-15 14:22:52,706 ERROR    java.sql.SQLException: Failed to run query

Now trying with the alternative JDBC drivers:

On PyAthenaJDBC v1.1.1 (AthenaJDBC v1.1.0):

2018-02-15 14:26:23,327 ERROR    Failed to execute query.
Traceback (most recent call last):
  File "/Users/adrian/projects/os/data-athena/venv/lib/python3.6/site-packages/pyathenajdbc/cursor.py", line 117, in execute
    result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
2018-02-15 14:26:23,333 ERROR    line 1:79: mismatched input 'in' expecting {<EOF>, 'GROUP', 'ORDER', 'HAVING', 'LIMIT', 'OR', 'AND', 'UNION', 'EXCEPT', 'INTERSECT'} (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: 32b8e811-125c-11e8-a9cb-57f70b9cca77)

On PyAthenaJDBC v1.3.1 (AthenaJDBC v1.0.1):

2018-02-15 14:24:31,141 ERROR    Failed to execute query.
Traceback (most recent call last):
  File "/Users/adrian/projects/os/data-athena/venv/lib/python3.6/site-packages/pyathenajdbc/cursor.py", line 172, in execute
    result_set = self._statement.executeQuery(query)
jpype._jexception.java.sql.SQLExceptionPyRaisable: java.sql.SQLException: Failed to run query
2018-02-15 14:24:31,237 ERROR    java.sql.SQLException: Failed to run query

from pyathenajdbc.

laughingman7743 avatar laughingman7743 commented on May 13, 2024

Thank you for the quick reply.
I understand that it is not a difference in JDBC driver version.
Please also let me know the version of Python you are running.

I think that the implementation before change is somewhat dirty. I will think about the smart implementation by hand over the error information on the weekend.
Please tell me if you know something good implementation method :)

from pyathenajdbc.

laughingman7743 avatar laughingman7743 commented on May 13, 2024
  File "/Users/adrian/projects/os/data-athena/venv/lib/python3.6/site-packages/pyathenajdbc/cursor.py", line 172, in execute

The execution environment is Python 3.6.

from pyathenajdbc.

laughingman7743 avatar laughingman7743 commented on May 13, 2024

Sorry for the late reply.
I fixed this issue with the following pull request. Please check it.
#55

Well, it has not changed much from the previous implementation 😂
Thanks,

from pyathenajdbc.

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.