Invalid SessionHandle
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Begin with the SQLAlchemy engine setup and n_engine.connect() example in the issue, then reproduce the delayed query using the listed Hive connection settings. Determine what happens when the session expires between connections and identify the relevant PyHive entry point or test; the issue names no repository files or completion criteria.
Written by the indexing model from the issue text.
Description
Hello,
I'm using pyhive with sqlAlchemy in my web application to to fetch data from hive, at first my queries seem to work just fine but after I leave it for a while and then try to run a query again I get the following error
"Internal server error (pyhive.exc.OperationalError) TExecuteStatementResp(status=TStatus(statusCode=3, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:
Invalid SessionHandle: SessionHandle [2ad56f2d-ff50-4266-885f-599341ca56b5]:12:11', 'org.apache.hive.service.cli.session.SessionManager:getSession:SessionManager.java:475',
Here is a sample of my code
from sqlalchemy import create_engine
import backend.settings as S
n_engine = create_engine(
f"hive://{S.HIVE_SERVER}:{S.HIVE_PORT}/{S.HIVE_DB_NLP}",
connect_args={"auth": S.HIVE_AUTH},
)
from core.databases import n_engine
with n_engine.connect() as conn:
query = """
SELECT
*
FROM most_frequent_words
WHERE 1 = 1 """
result_set = conn.execute(query)
result = result_set.mappings().all()
Is this some sort of a timeout error or am I doing something wrong here
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 545
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/PyHive
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100